render_with_collect method for template (#23283)
* Make entity_filter be a modifiable builder * Add render_with_collect method * Use sync render_with_collect and non-class based test case * Refactor: Template renders to RenderInfo * Freeze with exception too * Finish merging test changes * Removed unused sync interface * Final bits of the diff
This commit is contained in:
parent
581b16e9fa
commit
5b9d01139d
3 changed files with 474 additions and 90 deletions
|
@ -23,7 +23,6 @@ from homeassistant.const import (
|
|||
TEMP_CELSIUS, TEMP_FAHRENHEIT, WEEKDAYS, __version__)
|
||||
from homeassistant.core import valid_entity_id, split_entity_id
|
||||
from homeassistant.exceptions import TemplateError
|
||||
from homeassistant.helpers import template as template_helper
|
||||
from homeassistant.helpers.logging import KeywordStyleAdapter
|
||||
from homeassistant.util import slugify as util_slugify
|
||||
|
||||
|
@ -445,6 +444,8 @@ unit_system = vol.All(vol.Lower, vol.Any(CONF_UNIT_SYSTEM_METRIC,
|
|||
|
||||
def template(value):
|
||||
"""Validate a jinja2 template."""
|
||||
from homeassistant.helpers import template as template_helper
|
||||
|
||||
if value is None:
|
||||
raise vol.Invalid('template value is None')
|
||||
if isinstance(value, (list, dict, template_helper.Template)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue