Use eager_start to create async_update_alerts task in homeassistant_alerts (#114707)

If there are no alerts, the task will finish synchronously
This commit is contained in:
J. Nick Koston
2024-04-03 00:23:36 -10:00
committed by GitHub
parent ef047707d9
commit 80e066a7a8

View File

@@ -84,7 +84,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
if not coordinator.last_update_success: if not coordinator.last_update_success:
return return
hass.async_create_task(async_update_alerts()) hass.async_create_task(async_update_alerts(), eager_start=True)
coordinator = AlertUpdateCoordinator(hass) coordinator = AlertUpdateCoordinator(hass)
coordinator.async_add_listener(async_schedule_update_alerts) coordinator.async_add_listener(async_schedule_update_alerts)