Mercurial > templog
comparison py/sensor_ds18b20.py @ 175:33ed66a7ea0b
Ignore temp>80
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 Jul 2013 08:03:30 +0800 |
parents | 256505f98c4d |
children | 77c2a9caca3d |
comparison
equal
deleted
inserted
replaced
174:c49d87bb81b9 | 175:33ed66a7ea0b |
---|---|
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 |