Write SimpliSafe alarm control panel state after arming/disarming (#47649)
* Write SimpliSafe alarm control panel state after arming/disarming * Include locks
This commit is contained in:
parent
cf4954fead
commit
f92b75cbb2
2 changed files with 9 additions and 0 deletions
|
@ -163,6 +163,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity):
|
||||||
return
|
return
|
||||||
|
|
||||||
self._state = STATE_ALARM_DISARMED
|
self._state = STATE_ALARM_DISARMED
|
||||||
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def async_alarm_arm_home(self, code=None):
|
async def async_alarm_arm_home(self, code=None):
|
||||||
"""Send arm home command."""
|
"""Send arm home command."""
|
||||||
|
@ -178,6 +179,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity):
|
||||||
return
|
return
|
||||||
|
|
||||||
self._state = STATE_ALARM_ARMED_HOME
|
self._state = STATE_ALARM_ARMED_HOME
|
||||||
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def async_alarm_arm_away(self, code=None):
|
async def async_alarm_arm_away(self, code=None):
|
||||||
"""Send arm away command."""
|
"""Send arm away command."""
|
||||||
|
@ -193,6 +195,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity):
|
||||||
return
|
return
|
||||||
|
|
||||||
self._state = STATE_ALARM_ARMING
|
self._state = STATE_ALARM_ARMING
|
||||||
|
self.async_write_ha_state()
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_update_from_rest_api(self):
|
def async_update_from_rest_api(self):
|
||||||
|
|
|
@ -55,6 +55,9 @@ class SimpliSafeLock(SimpliSafeEntity, LockEntity):
|
||||||
LOGGER.error('Error while locking "%s": %s', self._lock.name, err)
|
LOGGER.error('Error while locking "%s": %s', self._lock.name, err)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self._is_locked = True
|
||||||
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def async_unlock(self, **kwargs):
|
async def async_unlock(self, **kwargs):
|
||||||
"""Unlock the lock."""
|
"""Unlock the lock."""
|
||||||
try:
|
try:
|
||||||
|
@ -63,6 +66,9 @@ class SimpliSafeLock(SimpliSafeEntity, LockEntity):
|
||||||
LOGGER.error('Error while unlocking "%s": %s', self._lock.name, err)
|
LOGGER.error('Error while unlocking "%s": %s', self._lock.name, err)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self._is_locked = False
|
||||||
|
self.async_write_ha_state()
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_update_from_rest_api(self):
|
def async_update_from_rest_api(self):
|
||||||
"""Update the entity with the provided REST API data."""
|
"""Update the entity with the provided REST API data."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue