diff --git a/homeassistant/helpers/event.py b/homeassistant/helpers/event.py index 55bb68fc6ec..dcc05675a01 100644 --- a/homeassistant/helpers/event.py +++ b/homeassistant/helpers/event.py @@ -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 diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 4d559a57c1f..c4c8f3a02f0 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -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: diff --git a/tests/helpers/test_template.py b/tests/helpers/test_template.py index b0643d1addf..5b32634d8f0 100644 --- a/tests/helpers/test_template.py +++ b/tests/helpers/test_template.py @@ -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)