Migrate zha to use Debouncer.async_schedule_call (#111103)

pull/111218/head
J. Nick Koston 2024-02-23 07:28:23 -10:00 committed by GitHub
parent 3ecbd05ac0
commit 59066c1770
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -324,7 +324,7 @@ class ZhaGroupEntity(BaseZhaEntity):
"""Handle child updates."""
# Delay to ensure that we get updates from all members before updating the group
assert self._change_listener_debouncer
self.hass.create_task(self._change_listener_debouncer.async_call())
self._change_listener_debouncer.async_schedule_call()
async def async_will_remove_from_hass(self) -> None:
"""Handle removal from Home Assistant."""

View File

@ -374,6 +374,7 @@ async def test_zha_group_fan_entity(
# test some of the group logic to make sure we key off states correctly
await send_attributes_report(hass, dev1_fan_cluster, {0: 0})
await send_attributes_report(hass, dev2_fan_cluster, {0: 0})
await hass.async_block_till_done()
# test that group fan is off
assert hass.states.get(entity_id).state == STATE_OFF