Mercurial > ~darius > hgwebdir.cgi > beermon
comparison MonitorDev.py @ 14:8ada8d5cca15
Move OWReadError to MonitorDev since that's where it's raised.
author | darius |
---|---|
date | Tue, 23 Oct 2007 01:05:21 +0000 |
parents | 24c7e85c3efd |
children | 67a4dc218bbf |
comparison
equal
deleted
inserted
replaced
13:3dad7161af87 | 14:8ada8d5cca15 |
---|---|
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 |