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