Run device_registry stop listener immediately (#114978)

pull/114994/head
J. Nick Koston 2024-04-05 15:59:27 -10:00 committed by GitHub
parent d25ac06326
commit 00db97a765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1259,7 +1259,9 @@ def async_setup_cleanup(hass: HomeAssistant, dev_reg: DeviceRegistry) -> None:
"""Cancel debounced cleanup."""
debounced_cleanup.async_cancel()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _on_homeassistant_stop)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, _on_homeassistant_stop, run_immediately=True
)
def _normalize_connections(connections: set[tuple[str, str]]) -> set[tuple[str, str]]: