Mercurial > code > home > repos > homeauto
annotate service/frontDoorMessage/automsg.py @ 1133:114ca7fd9d01
IR remote rule
Ignore-this: 901771de421a81129f2ddf4316af91d9
darcs-hash:a037a1bcf9631ac214fe1e61ff42fb00f25cb451
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 03 Feb 2018 14:38:10 -0800 |
parents | afc74853a1a4 |
children |
rev | line source |
---|---|
805 | 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, | |
840
afc74853a1a4
don't break automsg when livingroom temp is missing
drewp <drewp@bigasterisk.com>
parents:
805
diff
changeset
|
20 allTemp.get('livingRoom', 0), |
805 | 21 allTemp.get('frontDoor', 0)) |
22 fd.put("lastLine", payload=line) | |
23 time.sleep(60) |