mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Log template listeners when debug logging is on (#40180)
This commit is contained in:
parent
2489a6c6ef
commit
e9abb357e4
@ -581,6 +581,11 @@ class _TrackTemplateResultInfo:
|
|||||||
|
|
||||||
self._last_info = self._info.copy()
|
self._last_info = self._info.copy()
|
||||||
self._create_listeners()
|
self._create_listeners()
|
||||||
|
_LOGGER.debug(
|
||||||
|
"Template group %s listens for %s",
|
||||||
|
self._track_templates,
|
||||||
|
self.listeners,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def listeners(self) -> Dict:
|
def listeners(self) -> Dict:
|
||||||
@ -726,6 +731,10 @@ class _TrackTemplateResultInfo:
|
|||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
_LOGGER.debug(
|
||||||
|
"Template update %s triggered by event: %s", template.template, event
|
||||||
|
)
|
||||||
|
|
||||||
self._info[template] = template.async_render_to_info(
|
self._info[template] = template.async_render_to_info(
|
||||||
track_template_.variables
|
track_template_.variables
|
||||||
)
|
)
|
||||||
@ -751,6 +760,11 @@ class _TrackTemplateResultInfo:
|
|||||||
|
|
||||||
if info_changed:
|
if info_changed:
|
||||||
self._update_listeners()
|
self._update_listeners()
|
||||||
|
_LOGGER.debug(
|
||||||
|
"Template group %s listens for %s",
|
||||||
|
self._track_templates,
|
||||||
|
self.listeners,
|
||||||
|
)
|
||||||
self._last_info = self._info.copy()
|
self._last_info = self._info.copy()
|
||||||
|
|
||||||
if not updates:
|
if not updates:
|
||||||
|
@ -668,7 +668,7 @@ async def test_track_template_error(hass, caplog):
|
|||||||
hass.states.async_set("switch.not_exist", "off")
|
hass.states.async_set("switch.not_exist", "off")
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert "lunch" not in caplog.text
|
assert "no filter named 'lunch'" not in caplog.text
|
||||||
assert "TemplateAssertionError" not in caplog.text
|
assert "TemplateAssertionError" not in caplog.text
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user