Fixed value error exception

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

No files matched your search

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