Fixed value error exception

Fixed unittest
This commit is contained in:
Stefan Jonasson 2015-09-13 19:59:26 +02:00
parent a2ca60159d
commit e9da02d70c
2 changed files with 5 additions and 6 deletions

View file

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