Improve warning message in template rendering (#5806)

* improve warning message when template is none

* improve error message when template is none

* improve error message when template is none

* improve error message when template is none
This commit is contained in:
Daniel Høyer Iversen authored and Paulus Schoutsen committed 2017-02-08 09:07:43 -08:00
1 parent db6c166abe
commit 08efe2bf6d
2 files changed
+10 -6

No files matched your search

@@ -118,7 +118,8 @@ class BinarySensorTemplate(BinarySensorDevice):
if ex.args and ex.args[0].startswith(
"UndefinedError: 'None' has no attribute"):
# Common during HA startup - so just a warning
_LOGGER.warning(ex)
_LOGGER.warning('Could not render template %s,'
' the state is unknown.', self._name)
return
_LOGGER.error(ex)
_LOGGER.error('Could not render template %s: %s', self._name, ex)
self._state = False