From 2f88460b6832b85505e8deb3924af13eda5b18a2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 18 Mar 2024 21:43:14 -1000 Subject: [PATCH] Use async api in template weather to create tasks (#113784) --- homeassistant/components/template/weather.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/template/weather.py b/homeassistant/components/template/weather.py index 3d84eb1d07a..b572f0ecbb8 100644 --- a/homeassistant/components/template/weather.py +++ b/homeassistant/components/template/weather.py @@ -433,7 +433,9 @@ class WeatherTemplate(TemplateEntity, WeatherEntity): """Save template result and trigger forecast listener.""" attr_result = None if isinstance(result, TemplateError) else result setattr(self, f"_forecast_{forecast_type}", attr_result) - self.hass.create_task(self.async_update_listeners([forecast_type])) + self.hass.async_create_task( + self.async_update_listeners([forecast_type]), eager_start=True + ) @callback def _validate_forecast(