Undecorate RenderInfo result property (#39108)
parent
3e9963a216
commit
e55a014e94
|
@ -680,7 +680,7 @@ class _TrackTemplateResultInfo:
|
|||
info_changed = True
|
||||
|
||||
try:
|
||||
result: Union[str, TemplateError] = self._info[template].result
|
||||
result: Union[str, TemplateError] = self._info[template].result()
|
||||
except TemplateError as ex:
|
||||
result = ex
|
||||
|
||||
|
|
|
@ -175,7 +175,6 @@ class RenderInfo:
|
|||
split_entity_id(entity_id)[0] in self.domains or entity_id in self.entities
|
||||
)
|
||||
|
||||
@property
|
||||
def result(self) -> str:
|
||||
"""Results of the template computation."""
|
||||
if self.exception is not None:
|
||||
|
|
|
@ -51,7 +51,7 @@ def extract_entities(hass, template_str, variables=None):
|
|||
|
||||
def assert_result_info(info, result, entities=None, domains=None, all_states=False):
|
||||
"""Check result info."""
|
||||
assert info.result == result
|
||||
assert info.result() == result
|
||||
assert info.all_states == all_states
|
||||
assert info.filter_lifecycle("invalid_entity_name.somewhere") == all_states
|
||||
if entities is not None:
|
||||
|
@ -96,7 +96,7 @@ def test_invalid_template(hass):
|
|||
|
||||
info = tmpl.async_render_to_info()
|
||||
with pytest.raises(TemplateError):
|
||||
assert info.result == "impossible"
|
||||
assert info.result() == "impossible"
|
||||
|
||||
tmpl = template.Template("{{states(keyword)}}", hass)
|
||||
|
||||
|
|
Loading…
Reference in New Issue