Run dhcp listeners with run_immediately (#113726)

Neither of these need a call_soon
This commit is contained in:
J. Nick Koston 2024-03-18 04:16:20 -10:00 committed by GitHub
parent 3dc8df2403
commit 40ce2011be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,9 +157,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
for watcher in watchers:
watcher.async_stop()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, _async_stop, run_immediately=True
)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, _async_initialize)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STARTED, _async_initialize, run_immediately=True
)
return True