Skip to content

Commit

Permalink
wrap in async_on_unload
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Oct 3, 2024
1 parent 448c5f3 commit c7d6613
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions homeassistant/components/zha/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,11 @@ def __init__(
self._unsubs: list[Callable[[], None]] = []
self._unsubs.append(self.gateway.on_all_events(self._handle_event_protocol))
self._reload_task: asyncio.Task | None = None
self.hass.bus.async_listen(
er.EVENT_ENTITY_REGISTRY_UPDATED,
self._handle_entity_registry_updated,
config_entry.async_on_unload(
self.hass.bus.async_listen(
er.EVENT_ENTITY_REGISTRY_UPDATED,
self._handle_entity_registry_updated,
)
)

@property
Expand Down

0 comments on commit c7d6613

Please sign in to comment.