Skip to content

Commit a753926

Browse files
puddlyfrenck
authored andcommitted
Use async_schedule_reload instead of async_reload for ZHA (home-assistant#154397)
1 parent dc874ff commit a753926

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

homeassistant/components/zha/helpers.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ def __init__(
536536

537537
self._unsubs: list[Callable[[], None]] = []
538538
self._unsubs.append(self.gateway.on_all_events(self._handle_event_protocol))
539-
self._reload_task: asyncio.Task | None = None
540539
config_entry.async_on_unload(
541540
self.hass.bus.async_listen(
542541
er.EVENT_ENTITY_REGISTRY_UPDATED,
@@ -622,15 +621,7 @@ def handle_connection_lost(self, event: ConnectionLostEvent) -> None:
622621
"""Handle a connection lost event."""
623622

624623
_LOGGER.debug("Connection to the radio was lost: %r", event)
625-
626-
# Ensure we do not queue up multiple resets
627-
if self._reload_task is not None:
628-
_LOGGER.debug("Ignoring reset, one is already running")
629-
return
630-
631-
self._reload_task = self.hass.async_create_task(
632-
self.hass.config_entries.async_reload(self.config_entry.entry_id),
633-
)
624+
self.hass.config_entries.async_schedule_reload(self.config_entry.entry_id)
634625

635626
@callback
636627
def handle_device_joined(self, event: DeviceJoinedEvent) -> None:

0 commit comments

Comments
 (0)