Improve deCONZ state updates (#40601)

This commit is contained in:
Robert Svensson 2020-09-30 17:24:30 +02:00 committed by GitHub
parent ac71641c18
commit 082f866620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 72 additions and 60 deletions

View file

@ -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):