From 31a9c9451ee5db9c35420f075553fcfa8bc69ee7 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 18 Mar 2024 21:43:49 -1000 Subject: [PATCH] Use async api in generic_thermostat to create tasks (#113783) --- homeassistant/components/generic_thermostat/climate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/generic_thermostat/climate.py b/homeassistant/components/generic_thermostat/climate.py index 0ee96232d4c..42fd2ef6f41 100644 --- a/homeassistant/components/generic_thermostat/climate.py +++ b/homeassistant/components/generic_thermostat/climate.py @@ -279,7 +279,9 @@ class GenericThermostat(ClimateEntity, RestoreEntity): STATE_UNAVAILABLE, STATE_UNKNOWN, ): - self.hass.create_task(self._check_switch_initial_state()) + self.hass.async_create_task( + self._check_switch_initial_state(), eager_start=True + ) if self.hass.state is CoreState.running: _async_startup() @@ -443,7 +445,9 @@ class GenericThermostat(ClimateEntity, RestoreEntity): if new_state is None: return if old_state is None: - self.hass.create_task(self._check_switch_initial_state()) + self.hass.async_create_task( + self._check_switch_initial_state(), eager_start=True + ) self.async_write_ha_state() @callback