changeset 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 9e2181e3ce6d
children 6bacd8ca9f8f 424f1446f214
files py/sensor_ds18b20.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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