mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Avoid task creation when calling schedule_update_ha_state without force update (#91352)
This commit is contained in:
parent
9e1a670e6e
commit
445b823232
@ -698,10 +698,13 @@ class Entity(ABC):
|
||||
If state is changed more than once before the ha state change task has
|
||||
been executed, the intermediate state transitions will be missed.
|
||||
"""
|
||||
self.hass.create_task(
|
||||
self.async_update_ha_state(force_refresh),
|
||||
f"Entity {self.entity_id} schedule update ha state",
|
||||
)
|
||||
if force_refresh:
|
||||
self.hass.create_task(
|
||||
self.async_update_ha_state(force_refresh),
|
||||
f"Entity {self.entity_id} schedule update ha state",
|
||||
)
|
||||
else:
|
||||
self.hass.loop.call_soon_threadsafe(self.async_write_ha_state)
|
||||
|
||||
@callback
|
||||
def async_schedule_update_ha_state(self, force_refresh: bool = False) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user