From 40ce2011beaac02e345390ece9556d148e1141b7 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 18 Mar 2024 04:16:20 -1000 Subject: [PATCH] Run dhcp listeners with run_immediately (#113726) Neither of these need a call_soon --- homeassistant/components/dhcp/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/dhcp/__init__.py b/homeassistant/components/dhcp/__init__.py index 5325283eb0a..050bc7a74b2 100644 --- a/homeassistant/components/dhcp/__init__.py +++ b/homeassistant/components/dhcp/__init__.py @@ -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