mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix race in script wait for trigger step (#46055)
* Fix race in script wait for trigger step * Update script.py * Update script.py
This commit is contained in:
parent
f2d9e6f70c
commit
8a7e0241ab
@ -623,6 +623,8 @@ class _ScriptRun:
|
||||
variables = {**self._variables}
|
||||
self._variables["wait"] = {"remaining": delay, "trigger": None}
|
||||
|
||||
done = asyncio.Event()
|
||||
|
||||
async def async_done(variables, context=None):
|
||||
self._variables["wait"] = {
|
||||
"remaining": to_context.remaining if to_context else delay,
|
||||
@ -647,7 +649,6 @@ class _ScriptRun:
|
||||
return
|
||||
|
||||
self._changed()
|
||||
done = asyncio.Event()
|
||||
tasks = [
|
||||
self._hass.async_create_task(flag.wait()) for flag in (self._stop, done)
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user