comparison py/sensor_ds18b20.py @ 301:47c259458160

merge
author Matt Johnston <matt@ucc.asn.au>
date Sat, 06 Jul 2019 19:17:21 +0800
parents 97d99eb42d27
children
comparison
equal deleted inserted replaced
300:65a6b56fd18a 301:47c259458160
60 match = self.THERM_RE.match(contents) 60 match = self.THERM_RE.match(contents)
61 if match is None: 61 if match is None:
62 D("no match") 62 D("no match")
63 return None 63 return None
64 temp = int(match.groups(1)[0]) / 1000.0 64 temp = int(match.groups(1)[0]) / 1000.0
65 if temp > 80: 65 if temp > 80 or temp == 0:
66 E("Problem reading sensor '%s': %f" % (s, temp)) 66 E("Problem reading sensor '%s': %f" % (s, temp))
67 return None 67 return None
68 return temp 68 return temp
69 except Exception as e: 69 except Exception as e:
70 EX("Problem reading sensor '%s': %s" % (s, str(e))) 70 EX("Problem reading sensor '%s': %s" % (s, str(e)))