Commit 0b0685b7 authored by Alan Mitchell's avatar Alan Mitchell

Made sure Off command was also decoded.

parent 0f240866
......@@ -33,7 +33,7 @@ def convert_val(ts, reading_id, val, db):
if type(val) in (str, unicode):
if ('True' in val) or ('Closed' in val) or ('On' in val) or (val.startswith('Motion') or (val.startswith('Light')) or (val.startswith('Voltage'))):
val = 1.0
elif ('False' in val) or ('Open' in val) or (val.startswith('No')):
elif ('False' in val) or ('Open' in val) or ('Off' in val) or (val.startswith('No')):
val = 0.0
else:
# convert to float the first decimal number
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment