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:
parent
db6c166abe
commit
08efe2bf6d
2 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue