Mercurial > code > home > repos > homeauto
diff service/frontDoorMessage/automsg.py @ 805:9e99114dde57
start
Ignore-this: e06ac598970a0d4750f588ab89f56996
darcs-hash:20110801103030-836b1-376453383c1b9c6daac50cc790aa98906846fe56.gz
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Mon, 01 Aug 2011 03:30:30 -0700 |
parents | |
children | 912a3dae5c2c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/frontDoorMessage/automsg.py Mon Aug 01 03:30:30 2011 -0700 @@ -0,0 +1,23 @@ +""" +write the automatic last line to LCD /lastLine +""" +import sys, time +sys.path.append("/my/site/magma") +from datetime import datetime +from graphitetemp import getAllTemps + +import restkit + +# needs poller with status report + +while True: + fd = restkit.Resource("http://bang:9081/") + + allTemp = getAllTemps() + now = datetime.now() + + line = "%02d:%02d %02dF in, %02dF out" % (now.hour, now.minute, + allTemp['livingRoom'], + allTemp.get('frontDoor', 0)) + fd.put("lastLine", payload=line) + time.sleep(60)