Skip to content

Commit 06e7890

Browse files
authored
Merge pull request #8 from schmittx/door-state-update
Return discrete status for door state
2 parents ce5dbb6 + 2947ae5 commit 06e7890

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

pymyq/__init__.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class MyQAPI:
3333

3434
STATE_OPEN = 'open'
3535
STATE_CLOSED = 'closed'
36+
STATE_STOPPED = 'stopped'
37+
STATE_OPENING = 'opening'
38+
STATE_CLOSING = 'closing'
39+
STATE_UNKNOWN = 'unknown'
40+
STATE_TRANSITION = 'transition'
3641

3742
LOGIN_ENDPOINT = "api/v4/User/Validate"
3843
DEVICE_LIST_ENDPOINT = "api/v4/UserDeviceDetails/Get"
@@ -42,13 +47,15 @@ class MyQAPI:
4247
REQUEST_TIMEOUT = 3.0
4348

4449
DOOR_STATE = {
45-
'1': STATE_OPEN, #'open',
46-
'2': STATE_CLOSED, #'close',
47-
'3': STATE_OPEN, #'stopped',
48-
'4': STATE_OPEN, #'opening',
49-
'5': STATE_OPEN, #'closing',
50-
'8': STATE_OPEN, #'in_transition',
51-
'9': STATE_OPEN, #'open'
50+
'1': STATE_OPEN,
51+
'2': STATE_CLOSED,
52+
'3': STATE_STOPPED,
53+
'4': STATE_OPENING,
54+
'5': STATE_CLOSING,
55+
'6': STATE_UNKNOWN,
56+
'7': STATE_UNKNOWN,
57+
'8': STATE_TRANSITION,
58+
'9': STATE_OPEN,
5259
}
5360

5461
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)