@@ -28,6 +28,10 @@ class DeviceSpecificEventMixin:
2828## Payload models and metadata used by multiple event models.
2929
3030
31+ PluginDefinedData = dict [str , Any ]
32+ """Data of arbitrary structure that is defined in and relevant to the plugin."""
33+
34+
3135EncoderControllerType = Literal ["Encoder" ]
3236"""The 'Encoder' controller type refers to a dial or touchscreen on a 'Stream Deck +' device."""
3337KeypadControllerType = Literal ["Keypad" ]
@@ -38,8 +42,16 @@ class DeviceSpecificEventMixin:
3842CT = TypeVar ("CT" , bound = ControllerType , default = ControllerType )
3943
4044
41- PluginDefinedData = dict [str , Any ]
42- """Data of arbitrary structure that is defined in and relevant to the plugin."""
45+ class BasePayload (ConfiguredBaseModel , Generic [CT ], ABC ):
46+ """Base class for all complex payload models."""
47+ controller : CT
48+ """Defines the controller type the action is applicable to.
49+
50+ 'Keypad' refers to a standard action on a Stream Deck device, e.g. buttons or a pedal.
51+ 'Encoder' refers to a dial / touchscreen on a 'Stream Deck +' device.
52+ """
53+ settings : PluginDefinedData
54+ """Settings associated with the action instance."""
4355
4456
4557class CoordinatesDict (TypedDict ):
@@ -81,21 +93,8 @@ def coordinates(self) -> Coordinates:
8193 return Coordinates (** self .coordinates_obj )
8294
8395
84- class BasePayload (ConfiguredBaseModel , Generic [CT ], ABC ):
85- """Base class for all complex payload models."""
86- controller : CT
87- """Defines the controller type the action is applicable to.
88-
89- 'Keypad' refers to a standard action on a Stream Deck device, e.g. buttons or a pedal.
90- 'Encoder' refers to a dial / touchscreen on a 'Stream Deck +' device.
91- """
92- settings : PluginDefinedData
93- """Settings associated with the action instance."""
94-
95-
96- class BaseActionPayload (BasePayload [CT ], ABC ):
97- """Base class for payloads of action events."""
98-
96+ class StatefulActionPayloadMixin :
97+ """Mixin class for payload models that have an optional state field."""
9998 state : Optional [int ] = None # noqa: UP007
10099 """Current state of the action.
101100
0 commit comments