Skip to content

Commit

Permalink
Merge pull request #8 from schmittx/door-state-update
Browse files Browse the repository at this point in the history
Return discrete status for door state
  • Loading branch information
arraylabs authored Aug 21, 2018
2 parents ce5dbb6 + 2947ae5 commit 06e7890
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions pymyq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class MyQAPI:

STATE_OPEN = 'open'
STATE_CLOSED = 'closed'
STATE_STOPPED = 'stopped'
STATE_OPENING = 'opening'
STATE_CLOSING = 'closing'
STATE_UNKNOWN = 'unknown'
STATE_TRANSITION = 'transition'

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

DOOR_STATE = {
'1': STATE_OPEN, #'open',
'2': STATE_CLOSED, #'close',
'3': STATE_OPEN, #'stopped',
'4': STATE_OPEN, #'opening',
'5': STATE_OPEN, #'closing',
'8': STATE_OPEN, #'in_transition',
'9': STATE_OPEN, #'open'
'1': STATE_OPEN,
'2': STATE_CLOSED,
'3': STATE_STOPPED,
'4': STATE_OPENING,
'5': STATE_CLOSING,
'6': STATE_UNKNOWN,
'7': STATE_UNKNOWN,
'8': STATE_TRANSITION,
'9': STATE_OPEN,
}

logger = logging.getLogger(__name__)
Expand Down

0 comments on commit 06e7890

Please sign in to comment.