Mercurial > code > home > repos > homeauto
annotate service/frontDoorMessage/automsg.py @ 35:912a3dae5c2c
don't break automsg when livingroom temp is missing
Ignore-this: 44e1b7c6c671833338af6ad99d93554d
author | drewp@bigasterisk.com |
---|---|
date | Mon, 06 Aug 2012 20:18:29 -0700 |
parents | 6fd208b97616 |
children |
rev | line source |
---|---|
0 | 1 """ |
2 write the automatic last line to LCD /lastLine | |
3 """ | |
4 import sys, time | |
5 sys.path.append("/my/site/magma") | |
6 from datetime import datetime | |
7 from graphitetemp import getAllTemps | |
8 | |
9 import restkit | |
10 | |
11 # needs poller with status report | |
12 | |
13 while True: | |
14 fd = restkit.Resource("http://bang:9081/") | |
15 | |
16 allTemp = getAllTemps() | |
17 now = datetime.now() | |
18 | |
19 line = "%02d:%02d %02dF in, %02dF out" % (now.hour, now.minute, | |
35
912a3dae5c2c
don't break automsg when livingroom temp is missing
drewp@bigasterisk.com
parents:
0
diff
changeset
|
20 allTemp.get('livingRoom', 0), |
0 | 21 allTemp.get('frontDoor', 0)) |
22 fd.put("lastLine", payload=line) | |
23 time.sleep(60) |