1
0
mirror of https://github.com/home-assistant/core.git synced 2026-03-02 15:52:29 +00:00

Use async_schedule_reload instead of async_reload for ZHA (#154397)

This commit is contained in:
puddly
2025-10-14 10:26:40 -04:00
committed by GitHub
parent 11ee7d63be
commit 655de3dfd2

View File

@@ -536,7 +536,6 @@ class ZHAGatewayProxy(EventBase):
self._unsubs: list[Callable[[], None]] = []
self._unsubs.append(self.gateway.on_all_events(self._handle_event_protocol))
self._reload_task: asyncio.Task | None = None
config_entry.async_on_unload(
self.hass.bus.async_listen(
er.EVENT_ENTITY_REGISTRY_UPDATED,
@@ -622,15 +621,7 @@ class ZHAGatewayProxy(EventBase):
"""Handle a connection lost event."""
_LOGGER.debug("Connection to the radio was lost: %r", event)
# Ensure we do not queue up multiple resets
if self._reload_task is not None:
_LOGGER.debug("Ignoring reset, one is already running")
return
self._reload_task = self.hass.async_create_task(
self.hass.config_entries.async_reload(self.config_entry.entry_id),
)
self.hass.config_entries.async_schedule_reload(self.config_entry.entry_id)
@callback
def handle_device_joined(self, event: DeviceJoinedEvent) -> None: