Disable eager start for automations
fixes #117781 If a state change event triggers and automation which flips the state back and the websocket listener runs after the automation, the state changes would get delivered out of order
This commit is contained in:
parent
e708e30c33
commit
63d0e2a582
1 changed files with 12 additions and 7 deletions
|
@ -769,7 +769,7 @@ class _ScriptRun:
|
|||
context=self._context,
|
||||
return_response=return_response,
|
||||
),
|
||||
eager_start=True,
|
||||
eager_start=False,
|
||||
)
|
||||
)
|
||||
if response_variable:
|
||||
|
@ -786,12 +786,17 @@ class _ScriptRun:
|
|||
"""Activate the scene specified in the action."""
|
||||
self._step_log("activate scene")
|
||||
trace_set_result(scene=self._action[CONF_SCENE])
|
||||
await self._hass.services.async_call(
|
||||
await self._async_run_long_action(
|
||||
self._hass.async_create_task_internal(
|
||||
self._hass.services.async_call(
|
||||
scene.DOMAIN,
|
||||
SERVICE_TURN_ON,
|
||||
{ATTR_ENTITY_ID: self._action[CONF_SCENE]},
|
||||
blocking=True,
|
||||
context=self._context,
|
||||
),
|
||||
eager_start=False,
|
||||
)
|
||||
)
|
||||
|
||||
async def _async_event_step(self) -> None:
|
||||
|
|
Loading…
Add table
Reference in a new issue