Skip to content

Commit

Permalink
Define global constants for button names and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kane610 committed Jun 21, 2021
1 parent 9bf75ac commit 149b58c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pydeconz/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@
# RESOURCE_TYPE = "devices"
URL = "/devices"

BUTTON_ACTION_INITIAL_PRESS = "INITIAL_PRESS"
BUTTON_ACTION_SHORT_RELEASE = "SHORT_RELEASE"
BUTTON_ACTION_DOUBLE_PRESS = "DOUBLE_PRESS"
BUTTON_ACTION_TREBLE_PRESS = "TREBLE_PRESS"
BUTTON_ACTION_HOLD = "HOLD"
BUTTON_ACTION_LONG_RELEASE = "LONG_RELEASE"

BUTTON_NAME_BUTTON_1 = "Button 1"
BUTTON_NAME_CLOSE = "Close"
BUTTON_NAME_DIM_DOWN = "Dim Down"
BUTTON_NAME_DIM_UP = "Dim Up"
BUTTON_NAME_NEXT = "Next Scene"
BUTTON_NAME_OFF = "Off"
BUTTON_NAME_ON = "On"
BUTTON_NAME_ONOFF = "On/OFF"
BUTTON_NAME_OPEN = "Open"
BUTTON_NAME_PREVIOUS = "Previous Scene"
BUTTON_NAME_ROTATE_CLOCKWISE = "Rotate clockwise"
BUTTON_NAME_ROTATE_COUNTER_CLOCKWISE = "Rotate counter clockwise"


class Device(APIItem):
pass
Expand All @@ -30,6 +50,7 @@ def __init__(
async def introspect_button_event(self, model_unique_ids: Dict[str, str]) -> dict:
"""Introspect button event for unique ID."""
button_events = {}

for model_id, unique_id in model_unique_ids.items():
path = f"/{URL}/{unique_id}/state/buttonevent/introspect"
raw = await self._request("get", path)
Expand Down

0 comments on commit 149b58c

Please sign in to comment.