comparison py/sensor_ds18b20.py @ 474:435631e6d612

Ignore temp>80
author Matt Johnston <matt@ucc.asn.au>
date Thu, 25 Jul 2013 08:03:30 +0800
parents c34083c078db
children 77c2a9caca3d
comparison
equal deleted inserted replaced
473:bd29ddb360a5 474:435631e6d612
56 match = self.THERM_RE.match(contents) 56 match = self.THERM_RE.match(contents)
57 if match is None: 57 if match is None:
58 D("no match") 58 D("no match")
59 return None 59 return None
60 temp = int(match.groups(1)[0]) / 1000.0 60 temp = int(match.groups(1)[0]) / 1000.0
61 if temp > 80:
62 E("Problem reading sensor '%s': %f" % (s, temp))
63 return None
61 return temp 64 return temp
62 except Exception, e: 65 except Exception, e:
63 EX("Problem reading sensor '%s': %s" % (s, str(e))) 66 EX("Problem reading sensor '%s': %s" % (s, str(e)))
64 return None 67 return None
65 68