Improve deCONZ state updates (#40601)
This commit is contained in:
parent
ac71641c18
commit
082f866620
6 changed files with 72 additions and 60 deletions
|
@ -78,14 +78,11 @@ class DeconzBinarySensor(DeconzDevice, BinarySensorEntity):
|
|||
TYPE = DOMAIN
|
||||
|
||||
@callback
|
||||
def async_update_callback(self, force_update=False, ignore_update=False):
|
||||
def async_update_callback(self, force_update=False):
|
||||
"""Update the sensor's state."""
|
||||
if ignore_update:
|
||||
return
|
||||
|
||||
keys = {"on", "reachable", "state"}
|
||||
if force_update or self._device.changed_keys.intersection(keys):
|
||||
self.async_write_ha_state()
|
||||
super().async_update_callback(force_update=force_update)
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue