mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Improved upgradeability HomeKit security_systems (#13783)
This commit is contained in:
parent
2b86059fd0
commit
ae4e792651
@ -67,15 +67,13 @@ class SecuritySystem(HomeAccessory):
|
|||||||
return
|
return
|
||||||
|
|
||||||
hass_state = new_state.state
|
hass_state = new_state.state
|
||||||
if hass_state not in HASS_TO_HOMEKIT:
|
if hass_state in HASS_TO_HOMEKIT:
|
||||||
return
|
current_security_state = HASS_TO_HOMEKIT[hass_state]
|
||||||
|
self.char_current_state.set_value(current_security_state)
|
||||||
|
_LOGGER.debug('%s: Updated current state to %s (%d)',
|
||||||
|
self.entity_id, hass_state, current_security_state)
|
||||||
|
|
||||||
current_security_state = HASS_TO_HOMEKIT[hass_state]
|
if not self.flag_target_state:
|
||||||
self.char_current_state.set_value(current_security_state)
|
self.char_target_state.set_value(current_security_state)
|
||||||
_LOGGER.debug('%s: Updated current state to %s (%d)',
|
if self.char_target_state.value == self.char_current_state.value:
|
||||||
self.entity_id, hass_state, current_security_state)
|
self.flag_target_state = False
|
||||||
|
|
||||||
if not self.flag_target_state:
|
|
||||||
self.char_target_state.set_value(current_security_state)
|
|
||||||
if self.char_target_state.value == self.char_current_state.value:
|
|
||||||
self.flag_target_state = False
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user