From 655de3dfd2c65536a044730af017bd97615aef5d Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:26:40 -0400 Subject: [PATCH] Use `async_schedule_reload` instead of `async_reload` for ZHA (#154397) --- homeassistant/components/zha/helpers.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/homeassistant/components/zha/helpers.py b/homeassistant/components/zha/helpers.py index f5b44eb8fc4..f8f1bd78805 100644 --- a/homeassistant/components/zha/helpers.py +++ b/homeassistant/components/zha/helpers.py @@ -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: