Fix service device refresh calling state update (#30920)
This commit is contained in:
parent
7b29a498c6
commit
c9db21ffac
8 changed files with 44 additions and 27 deletions
|
@ -54,11 +54,13 @@ class DeconzBinarySensor(DeconzDevice, BinarySensorDevice):
|
|||
"""Representation of a deCONZ binary sensor."""
|
||||
|
||||
@callback
|
||||
def async_update_callback(self, force_update=False):
|
||||
def async_update_callback(self, force_update=False, ignore_update=False):
|
||||
"""Update the sensor's state."""
|
||||
changed = set(self._device.changed_keys)
|
||||
if ignore_update:
|
||||
return
|
||||
|
||||
keys = {"on", "reachable", "state"}
|
||||
if force_update or any(key in changed for key in keys):
|
||||
if force_update or self._device.changed_keys.intersection(keys):
|
||||
self.async_schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue