mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Allow stopping a script with a response value (#95284)
This commit is contained in:
@ -675,8 +675,14 @@ async def handle_execute_script(
|
||||
|
||||
context = connection.context(msg)
|
||||
script_obj = Script(hass, msg["sequence"], f"{const.DOMAIN} script", const.DOMAIN)
|
||||
await script_obj.async_run(msg.get("variables"), context=context)
|
||||
connection.send_result(msg["id"], {"context": context})
|
||||
response = await script_obj.async_run(msg.get("variables"), context=context)
|
||||
connection.send_result(
|
||||
msg["id"],
|
||||
{
|
||||
"context": context,
|
||||
"response": response,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@callback
|
||||
|
Reference in New Issue
Block a user