mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
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:
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user