1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Extract variable rendering (#39934)

This commit is contained in:
Paulus Schoutsen
2020-09-11 12:24:16 +02:00
committed by GitHub
parent 9389a7c9be
commit 5117a16841
8 changed files with 193 additions and 25 deletions

View File

@@ -81,7 +81,10 @@ from homeassistant.const import (
)
from homeassistant.core import split_entity_id, valid_entity_id
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import template as template_helper
from homeassistant.helpers import (
script_variables as script_variables_helper,
template as template_helper,
)
from homeassistant.helpers.logging import KeywordStyleAdapter
from homeassistant.util import slugify as util_slugify
import homeassistant.util.dt as dt_util
@@ -863,7 +866,11 @@ def make_entity_service_schema(
)
SCRIPT_VARIABLES_SCHEMA = vol.Schema({str: template_complex})
SCRIPT_VARIABLES_SCHEMA = vol.All(
vol.Schema({str: template_complex}),
# pylint: disable=unnecessary-lambda
lambda val: script_variables_helper.ScriptVariables(val),
)
def script_action(value: Any) -> dict: