Update condition.py (#15021)

* Update condition.py

Added code that writes to warning-log what entity causes a problem when 'value cannot be processed as a number', making troubleshooting easier.

* Make a one-line warning
This commit is contained in:
Raoul Teeuwen 2018-06-19 13:26:52 +02:00 committed by Fabian Affolter
parent 1e7333eeb6
commit 27873b4457

View file

@ -166,7 +166,8 @@ def async_numeric_state(hass: HomeAssistant, entity, below=None, above=None,
try:
value = float(value)
except ValueError:
_LOGGER.warning("Value cannot be processed as a number: %s", value)
_LOGGER.warning("Value cannot be processed as a number: %s "
"(Offending entity: %s)", entity, value)
return False
if below is not None and value >= below: