Skip to content

Commit b622025

Browse files
committed
Added dialDown event for Stream Deck + encoders; Added dialUp event for Stream Deck + encoders.
1 parent a17ac3c commit b622025

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

src/streamdeck_sdk/event_routings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ class EventRoutingObj:
2929
obj=events_received_objs.TouchTap,
3030
handler_name="on_touch_tap",
3131
),
32+
"dialDown": EventRoutingObj(
33+
obj=events_received_objs.DialDown,
34+
handler_name="on_dial_down",
35+
),
36+
"dialUp": EventRoutingObj(
37+
obj=events_received_objs.DialUp,
38+
handler_name="on_dial_up",
39+
),
3240
"dialPress": EventRoutingObj(
3341
obj=events_received_objs.DialPress,
3442
handler_name="on_dial_press",

src/streamdeck_sdk/events_received_objs.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ class TouchTapPayload(BaseModel):
115115
hold: bool
116116

117117

118+
class DialDownPayload(BaseModel):
119+
controller: str
120+
settings: str
121+
coordinates: KeyCoordinates
122+
123+
124+
class DialUpPayload(BaseModel):
125+
controller: str
126+
settings: str
127+
coordinates: KeyCoordinates
128+
129+
118130
# endregion NestedModels
119131

120132
# region Models
@@ -155,6 +167,22 @@ class TouchTap(BaseModel):
155167
event: str = "touchTap"
156168

157169

170+
class DialDown(BaseModel):
171+
action: str
172+
context: str
173+
device: str
174+
payload: DialDownPayload
175+
event: str = "dialDown"
176+
177+
178+
class DialUp(BaseModel):
179+
action: str
180+
context: str
181+
device: str
182+
payload: DialUpPayload
183+
event: str = "dialUp"
184+
185+
158186
class DialPress(BaseModel):
159187
action: str
160188
context: str

src/streamdeck_sdk/mixins.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ def on_key_up(self, obj: events_received_objs.KeyUp) -> None:
198198
def on_touch_tap(self, obj: events_received_objs.TouchTap) -> None:
199199
pass
200200

201+
def on_dial_down(self, obj: events_received_objs.DialDown) -> None:
202+
pass
203+
204+
def on_dial_up(self, obj: events_received_objs.DialUp) -> None:
205+
pass
206+
201207
def on_dial_press(self, obj: events_received_objs.DialPress) -> None:
202208
pass
203209

src/streamdeck_sdk/sdk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
*,
5151
log_file: Path = None,
5252
log_level: int = logging.DEBUG,
53-
log_max_bytes: int = 3 * 1024 * 1024,
53+
log_max_bytes: int = 3 * 1024 * 1024, # 3 MB
5454
log_backup_count: int = 2,
5555
):
5656
if log_file is not None:
@@ -219,7 +219,7 @@ def __init_actions(self) -> None:
219219
except AttributeError:
220220
action_class = str(action.__class__)
221221
message = f"{action_class} must have attribute UUID"
222-
logger.error(message)
222+
logger.error(message, exc_info=True)
223223
raise AttributeError(message)
224224
action.ws = self.ws
225225
action.plugin_uuid = self.plugin_uuid

0 commit comments

Comments
 (0)