mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use async api in generic_thermostat to create tasks (#113783)
This commit is contained in:
parent
3bb0d04452
commit
31a9c9451e
@ -279,7 +279,9 @@ class GenericThermostat(ClimateEntity, RestoreEntity):
|
|||||||
STATE_UNAVAILABLE,
|
STATE_UNAVAILABLE,
|
||||||
STATE_UNKNOWN,
|
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:
|
if self.hass.state is CoreState.running:
|
||||||
_async_startup()
|
_async_startup()
|
||||||
@ -443,7 +445,9 @@ class GenericThermostat(ClimateEntity, RestoreEntity):
|
|||||||
if new_state is None:
|
if new_state is None:
|
||||||
return
|
return
|
||||||
if old_state is None:
|
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()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user