Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions homeassistant/components/homekit/type_security_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ def update_state(self, entity_id=None, old_state=None, new_state=None):
return

hass_state = new_state.state
if hass_state not 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)

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
if hass_state in HASS_TO_HOMEKIT:
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)

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