From 7b67a486bd22f9c8bb7c18145beefea00128c4c8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 19 Mar 2024 14:07:57 -1000 Subject: [PATCH] Migrate legacy device_tracker shutdown to use run_immediately (#113835) A call_soon is not needed here --- homeassistant/components/device_tracker/legacy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/device_tracker/legacy.py b/homeassistant/components/device_tracker/legacy.py index 72fc4ef717b..0f0d842c595 100644 --- a/homeassistant/components/device_tracker/legacy.py +++ b/homeassistant/components/device_tracker/legacy.py @@ -271,7 +271,9 @@ async def _async_setup_legacy_integration( """ cancel_update_stale() - hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _on_hass_stop) + hass.bus.async_listen_once( + EVENT_HOMEASSISTANT_STOP, _on_hass_stop, run_immediately=True + ) @attr.s