diff py/sensor_ds18b20.py @ 294:6bacd8ca9f8f

merge
author Matt Johnston <matt@ucc.asn.au>
date Sat, 06 Jul 2019 18:30:25 +0800
parents 97d99eb42d27
children
line wrap: on
line diff
--- a/py/sensor_ds18b20.py	Sat Jul 06 18:29:45 2019 +0800
+++ b/py/sensor_ds18b20.py	Sat Jul 06 18:30:25 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
@@ -88,6 +88,8 @@
             E("No W1 sensors found")
             return []
         names = contents.split()
+        # only ds18b20
+        names = [n for n in names if n.startswith('28-')]
         return names
 
     def wort_name(self):