Fix calling empty script turn off (#24827)
This commit is contained in:
1 parent
fafc68673a
commit
2886b217ab
2 files changed
+16
-1
No files matched your search
@@ -79,9 +79,14 @@ async def async_setup(hass, config):
|
||||
async def turn_off_service(service):
|
||||
"""Cancel a script."""
|
||||
# Stopping a script is ok to be done in parallel
|
||||
scripts = await component.async_extract_from_service(service)
|
||||
|
||||
if not scripts:
|
||||
return
|
||||
|
||||
await asyncio.wait([
|
||||
script.async_turn_off() for script
|
||||
in await component.async_extract_from_service(service)
|
||||
in scripts
|
||||
])
|
||||
|
||||
async def toggle_service(service):
|
||||
|
||||
Reference in new issue
Block a user