Ensure SimpliSafe state sync when websocket falters (#33680)
parent
d33cf28936
commit
c8df5fb8ad
|
@ -217,6 +217,20 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanel):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Although system state updates are designed the come via the websocket, the
|
||||||
|
# SimpliSafe cloud can sporadically fail to send those updates as expected; so,
|
||||||
|
# just in case, we synchronize the state via the REST API, too:
|
||||||
|
if self._system.state == SystemStates.away:
|
||||||
|
self._state = STATE_ALARM_ARMED_AWAY
|
||||||
|
elif self._system.state in (SystemStates.away_count, SystemStates.exit_delay):
|
||||||
|
self._state = STATE_ALARM_ARMING
|
||||||
|
elif self._system.state == SystemStates.home:
|
||||||
|
self._state = STATE_ALARM_ARMED_HOME
|
||||||
|
elif self._system.state == SystemStates.off:
|
||||||
|
self._state = STATE_ALARM_DISARMED
|
||||||
|
else:
|
||||||
|
self._state = None
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_update_from_websocket_event(self, event):
|
def async_update_from_websocket_event(self, event):
|
||||||
"""Update the entity with the provided websocket API event data."""
|
"""Update the entity with the provided websocket API event data."""
|
||||||
|
|
Loading…
Reference in New Issue