mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
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:
parent
1e7333eeb6
commit
27873b4457
@ -166,7 +166,8 @@ def async_numeric_state(hass: HomeAssistant, entity, below=None, above=None,
|
|||||||
try:
|
try:
|
||||||
value = float(value)
|
value = float(value)
|
||||||
except ValueError:
|
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
|
return False
|
||||||
|
|
||||||
if below is not None and value >= below:
|
if below is not None and value >= below:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user