Mercurial > ~darius > hgwebdir.cgi > beermon.old
comparison MonitorDev.py @ 16:f1832dec26e3 default tip
Move OWReadError to MonitorDev since that's where it's raised.
author | darius |
---|---|
date | Tue, 23 Oct 2007 01:05:21 +0000 |
parents | 9d5b291cfd01 |
children |
comparison
equal
deleted
inserted
replaced
15:dc751c2d415e | 16:f1832dec26e3 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 ############################################################################ | 3 ############################################################################ |
4 # Monitoring/control interface to hardware for beermon | 4 # Monitoring/control interface to hardware for beermon |
5 # | 5 # |
6 # $Id: MonitorDev.py,v 1.2 2007/09/29 14:51:20 darius Exp $ | 6 # $Id: MonitorDev.py,v 1.3 2007/10/23 01:05:22 darius Exp $ |
7 # | 7 # |
8 # Depends on: Python 2.3 (I think) | 8 # Depends on: Python 2.3 (I think) |
9 # | 9 # |
10 ############################################################################ | 10 ############################################################################ |
11 # | 11 # |
33 # SUCH DAMAGE. | 33 # SUCH DAMAGE. |
34 # | 34 # |
35 ############################################################################ | 35 ############################################################################ |
36 | 36 |
37 import threading, re, time, pexpect | 37 import threading, re, time, pexpect |
38 | |
39 class OWReadError(Exception): | |
40 """Raised when we failed to read from a 1-wire device, could be a timeout | |
41 or the device is non-existent, etc""" | |
42 pass | |
38 | 43 |
39 class MonitorDev(threading.Thread): | 44 class MonitorDev(threading.Thread): |
40 """This class continually polls the hardware for temperature | 45 """This class continually polls the hardware for temperature |
41 readings and accepts state changes to heat & cool""" | 46 readings and accepts state changes to heat & cool""" |
42 | 47 |