mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 10:48:01 +02:00
Extend template entities with a script section (#96175)
* Extend template entities with a script section This allows making a trigger entity that triggers a few times a day, and allows collecting data from a service resopnse which can be fed into a template entity. The current alternatives are to publish and subscribe to events or to store data in input entities. * Make variables set in actions accessible to templates * Format code --------- Co-authored-by: Erik <erik@montnemery.com>
This commit is contained in:
@ -713,12 +713,12 @@ async def handle_execute_script(
|
||||
|
||||
context = connection.context(msg)
|
||||
script_obj = Script(hass, script_config, f"{const.DOMAIN} script", const.DOMAIN)
|
||||
response = await script_obj.async_run(msg.get("variables"), context=context)
|
||||
script_result = await script_obj.async_run(msg.get("variables"), context=context)
|
||||
connection.send_result(
|
||||
msg["id"],
|
||||
{
|
||||
"context": context,
|
||||
"response": response,
|
||||
"response": script_result.service_response if script_result else None,
|
||||
},
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user