Fixed value error exception
Fixed unittest
This commit is contained in:
parent
a2ca60159d
commit
e9da02d70c
2 changed files with 5 additions and 6 deletions
|
@ -40,12 +40,12 @@ def register(hass, config, action):
|
|||
:return:
|
||||
"""
|
||||
|
||||
if value is None:
|
||||
try:
|
||||
value = float(value)
|
||||
except ValueError:
|
||||
_LOGGER.warn("Missing value in numeric check")
|
||||
return False
|
||||
|
||||
value = float(value)
|
||||
|
||||
if range_start is not None and range_end is not None:
|
||||
return float(range_start) <= value < float(range_end)
|
||||
elif range_end is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue