Start tasks eagerly in for async_at_start(ed) (#112802)

This commit is contained in:
J. Nick Koston 2024-03-11 08:46:11 -10:00 committed by GitHub
parent ff4e9eb31e
commit d7cc30fd2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,7 @@ def _async_at_core_state(
"""
at_start_job = HassJob(at_start_cb)
if check_state(hass):
hass.async_run_hass_job(at_start_job, hass)
hass.async_run_hass_job(at_start_job, hass, eager_start=True)
return lambda: None
unsub: None | CALLBACK_TYPE = None
@ -38,7 +38,7 @@ def _async_at_core_state(
@callback
def _matched_event(event: Event) -> None:
"""Call the callback when Home Assistant started."""
hass.async_run_hass_job(at_start_job, hass)
hass.async_run_hass_job(at_start_job, hass, eager_start=True)
nonlocal unsub
unsub = None