Use async api in template weather to create tasks (#113784)
parent
d740e4c3d7
commit
2f88460b68
|
@ -433,7 +433,9 @@ class WeatherTemplate(TemplateEntity, WeatherEntity):
|
||||||
"""Save template result and trigger forecast listener."""
|
"""Save template result and trigger forecast listener."""
|
||||||
attr_result = None if isinstance(result, TemplateError) else result
|
attr_result = None if isinstance(result, TemplateError) else result
|
||||||
setattr(self, f"_forecast_{forecast_type}", attr_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
|
@callback
|
||||||
def _validate_forecast(
|
def _validate_forecast(
|
||||||
|
|
Loading…
Reference in New Issue