forked from home-assistant/core
Use async api in generic_thermostat to create tasks (#113783)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user