Migrate _async_when_setup to use eager_start (#112872)

This one does not make much difference, but its a lot
easier to do it now instead of in the future
This commit is contained in:
J. Nick Koston 2024-03-11 09:02:35 -10:00 committed by GitHub
parent 89c24b2f75
commit 5e94858821
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -601,11 +601,14 @@ def _async_when_setup(
EVENT_COMPONENT_LOADED,
_matched_event,
event_filter=_async_is_component_filter,
run_immediately=True,
)
)
if start_event:
listeners.append(
hass.bus.async_listen(EVENT_HOMEASSISTANT_START, _matched_event)
hass.bus.async_listen(
EVENT_HOMEASSISTANT_START, _matched_event, run_immediately=True
)
)