Skip to content

Commit

Permalink
-Fixed bad door status being detected at MSG100 bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogeniola committed Jul 1, 2019
1 parent 9c9cda2 commit 1765ba2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/meross_cloud/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ def __init__(self, device: GenericGarageDoorOpener, channel: int):
self._device_name = "%s (channel: %d)" % (self._device.name, self._channel)
device.register_event_callback(self.handler)

# If the device is online, we need to update its status from STATE_UNKNOWN
if device.online and self._state == STATE_UNKNOWN:
open = device.get_status().get(self._channel)
if open:
self._state = STATE_OPEN
else:
self._state = STATE_CLOSED

def handler(self, evt) -> None:
if evt.channel == self._channel:
# The underlying library only exposes "open" and "closed" statuses
Expand Down

0 comments on commit 1765ba2

Please sign in to comment.