Clean up custom polling in ZHA device and light (#32653)
* cleanup timer handle when device is removed * separate unavailable times for mains vs battery * better name * remove light refresh handle when removing light * remove unused parallel updates * don't steal HA const for different purpose * don't flood network every hour for lights * update test to test both intervals * add test for light refresh interval * fix tests * update test * put parallel updates back for now... * fix async_schedule_update_ha_state usage * review comment * review comment * update test - review conversation * review comments * await count not call count * flip some state
This commit is contained in:
1 parent
99109d162b
commit
4248893007
13 files changed
+122
-41
No files matched your search
@@ -106,7 +106,7 @@ class BinarySensor(ZhaEntity, BinarySensorDevice):
|
||||
def async_set_state(self, attr_id, attr_name, value):
|
||||
"""Set the state."""
|
||||
self._state = bool(value)
|
||||
self.async_schedule_update_ha_state()
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_update(self):
|
||||
"""Attempt to retrieve on off state from the binary sensor."""
|
||||
|
||||
Reference in new issue
Block a user