changeset 474:435631e6d612

Ignore temp>80
author Matt Johnston <matt@ucc.asn.au>
date Thu, 25 Jul 2013 08:03:30 +0800
parents bd29ddb360a5
children 6af0dcc5da45
files py/sensor_ds18b20.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/py/sensor_ds18b20.py	Thu Jul 25 08:03:14 2013 +0800
+++ b/py/sensor_ds18b20.py	Thu Jul 25 08:03:30 2013 +0800
@@ -58,6 +58,9 @@
                 D("no match")
                 return None
             temp = int(match.groups(1)[0]) / 1000.0
+            if temp > 80:
+                E("Problem reading sensor '%s': %f" % (s, temp))
+                return None
             return temp
         except Exception, e:
             EX("Problem reading sensor '%s': %s" % (s, str(e)))