1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Run registry cleanup listeners immediately (#113646)

This commit is contained in:
J. Nick Koston
2024-03-17 08:15:55 -10:00
committed by GitHub
parent 091199d24a
commit 93497dde8b
3 changed files with 17 additions and 15 deletions

View File

@@ -1191,6 +1191,7 @@ def async_setup_cleanup(hass: HomeAssistant, dev_reg: DeviceRegistry) -> None:
entity_registry.EVENT_ENTITY_REGISTRY_UPDATED,
_async_entity_registry_changed,
event_filter=entity_registry_changed_filter,
run_immediately=True,
)
return
@@ -1200,10 +1201,13 @@ def async_setup_cleanup(hass: HomeAssistant, dev_reg: DeviceRegistry) -> None:
entity_registry.EVENT_ENTITY_REGISTRY_UPDATED,
_async_entity_registry_changed,
event_filter=entity_registry_changed_filter,
run_immediately=True,
)
await debounced_cleanup.async_call()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, startup_clean)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STARTED, startup_clean, run_immediately=True
)
@callback
def _on_homeassistant_stop(event: Event) -> None: