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 2017-02-08 18:07:43 +01:00 committed by Paulus Schoutsen
parent db6c166abe
commit 08efe2bf6d
2 changed files with 10 additions and 6 deletions

View file

@ -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