From 51f871227ed1e716a38b4d30518964888354253e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 11 Mar 2024 15:34:32 -1000 Subject: [PATCH] Attach template triggers at start eagerly (#113120) This method calls async_initialize_triggers which is likely to never suspend and the attach can avoid being scheduled on the event loop --- homeassistant/components/template/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/template/coordinator.py b/homeassistant/components/template/coordinator.py index e0beaead2fe..4e86d629990 100644 --- a/homeassistant/components/template/coordinator.py +++ b/homeassistant/components/template/coordinator.py @@ -47,7 +47,7 @@ class TriggerUpdateCoordinator(DataUpdateCoordinator): await self._attach_triggers() else: self._unsub_start = self.hass.bus.async_listen_once( - EVENT_HOMEASSISTANT_START, self._attach_triggers + EVENT_HOMEASSISTANT_START, self._attach_triggers, run_immediately=True ) for platform_domain in PLATFORMS: