Directly call async_write_ha_state (#33508)

* Directly call async_write_ha_state

* Address comments

* Fix tests
This commit is contained in:
Paulus Schoutsen 2020-04-01 14:19:51 -07:00 committed by GitHub
parent 4e043b3123
commit aaa1d06809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
129 changed files with 263 additions and 278 deletions

View file

@ -109,7 +109,7 @@ class DeconzSensor(DeconzDevice):
keys = {"on", "reachable", "state"}
if force_update or self._device.changed_keys.intersection(keys):
self.async_schedule_update_ha_state()
self.async_write_ha_state()
@property
def state(self):
@ -174,7 +174,7 @@ class DeconzBattery(DeconzDevice):
keys = {"battery", "reachable"}
if force_update or self._device.changed_keys.intersection(keys):
self.async_schedule_update_ha_state()
self.async_write_ha_state()
@property
def unique_id(self):