mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix automation & script restart mode bug (#37909)
This commit is contained in:
parent
a224b944e9
commit
716cee6907
@ -760,13 +760,15 @@ class Script:
|
||||
raise
|
||||
|
||||
async def _async_stop(self, update_state):
|
||||
await asyncio.wait([run.async_stop() for run in self._runs])
|
||||
aws = [run.async_stop() for run in self._runs]
|
||||
if not aws:
|
||||
return
|
||||
await asyncio.wait(aws)
|
||||
if update_state:
|
||||
self._changed()
|
||||
|
||||
async def async_stop(self, update_state: bool = True) -> None:
|
||||
"""Stop running script."""
|
||||
if self.is_running:
|
||||
await asyncio.shield(self._async_stop(update_state))
|
||||
|
||||
async def _async_get_condition(self, config):
|
||||
|
Loading…
x
Reference in New Issue
Block a user