mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Fix race condition when ZHA group members change (#113030)
This commit is contained in:
parent
db31afe019
commit
fad5fc5256
@ -311,6 +311,10 @@ class ZhaGroupEntity(BaseZhaEntity):
|
||||
|
||||
self._handled_group_membership = True
|
||||
await self.async_remove(force_remove=True)
|
||||
if len(self._group.members) >= 2:
|
||||
async_dispatcher_send(
|
||||
self.hass, SIGNAL_GROUP_ENTITY_REMOVED, self._group_id
|
||||
)
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Register callbacks."""
|
||||
@ -337,13 +341,6 @@ class ZhaGroupEntity(BaseZhaEntity):
|
||||
self.hass, self._entity_ids, self.async_state_changed_listener
|
||||
)
|
||||
|
||||
def send_removed_signal():
|
||||
async_dispatcher_send(
|
||||
self.hass, SIGNAL_GROUP_ENTITY_REMOVED, self._group_id
|
||||
)
|
||||
|
||||
self.async_on_remove(send_removed_signal)
|
||||
|
||||
@callback
|
||||
def async_state_changed_listener(self, event: Event[EventStateChangedData]) -> None:
|
||||
"""Handle child updates."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user