mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-12 22:25:36 -04:00
Reduce lagging update
This commit is contained in:
parent
c433714a94
commit
80b3741f2f
10 changed files with 57 additions and 24 deletions
|
@ -271,9 +271,10 @@ class HonBinarySensorEntity(HonEntity, BinarySensorEntity):
|
|||
)
|
||||
|
||||
@callback
|
||||
def _handle_coordinator_update(self):
|
||||
def _handle_coordinator_update(self, update=True) -> None:
|
||||
self._attr_native_value = (
|
||||
self._device.get(self.entity_description.key, "")
|
||||
== self.entity_description.on_value
|
||||
)
|
||||
self.async_write_ha_state()
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue