Skip to content

Commit 0ee257d

Browse files
committed
Define global constants for button names and actions
1 parent 5092b62 commit 0ee257d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pydeconz/device.py

+21
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@
1111
# RESOURCE_TYPE = "devices"
1212
URL = "/devices"
1313

14+
BUTTON_ACTION_INITIAL_PRESS = "INITIAL_PRESS"
15+
BUTTON_ACTION_SHORT_RELEASE = "SHORT_RELEASE"
16+
BUTTON_ACTION_DOUBLE_PRESS = "DOUBLE_PRESS"
17+
BUTTON_ACTION_TREBLE_PRESS = "TREBLE_PRESS"
18+
BUTTON_ACTION_HOLD = "HOLD"
19+
BUTTON_ACTION_LONG_RELEASE = "LONG_RELEASE"
20+
21+
BUTTON_NAME_BUTTON_1 = "Button 1"
22+
BUTTON_NAME_CLOSE = "Close"
23+
BUTTON_NAME_DIM_DOWN = "Dim Down"
24+
BUTTON_NAME_DIM_UP = "Dim Up"
25+
BUTTON_NAME_NEXT = "Next Scene"
26+
BUTTON_NAME_OFF = "Off"
27+
BUTTON_NAME_ON = "On"
28+
BUTTON_NAME_ONOFF = "On/OFF"
29+
BUTTON_NAME_OPEN = "Open"
30+
BUTTON_NAME_PREVIOUS = "Previous Scene"
31+
BUTTON_NAME_ROTATE_CLOCKWISE = "Rotate clockwise"
32+
BUTTON_NAME_ROTATE_COUNTER_CLOCKWISE = "Rotate counter clockwise"
33+
1434

1535
class Device(APIItem):
1636
pass
@@ -30,6 +50,7 @@ def __init__(
3050
async def introspect_button_event(self, model_unique_ids: Dict[str, str]) -> dict:
3151
"""Introspect button event for unique ID."""
3252
button_events = {}
53+
3354
for model_id, unique_id in model_unique_ids.items():
3455
path = f"/{URL}/{unique_id}/state/buttonevent/introspect"
3556
raw = await self._request("get", path)

0 commit comments

Comments
 (0)