diff py/sensor_ds18b20.py @ 287:97d99eb42d27 py3client

temp == 0 is a problem
author Matt Johnston <matt@ucc.asn.au>
date Wed, 26 Jun 2019 22:52:03 +0800
parents 20c89630be6c
children
line wrap: on
line diff
--- a/py/sensor_ds18b20.py	Fri Feb 17 21:22:59 2017 +0800
+++ b/py/sensor_ds18b20.py	Wed Jun 26 22:52:03 2019 +0800
@@ -62,7 +62,7 @@
                 D("no match")
                 return None
             temp = int(match.groups(1)[0]) / 1000.0
-            if temp > 80:
+            if temp > 80 or temp == 0:
                 E("Problem reading sensor '%s': %f" % (s, temp))
                 return None
             return temp