Mercurial > code > home > repos > homeauto
changeset 128:06ad4a0f42c0
fix shuttlepro outgoing uri
Ignore-this: c07186778bb07dab9e78c92f10f53a9b
author | drewp@bigasterisk.com |
---|---|
date | Tue, 08 Oct 2013 21:39:06 -0700 |
parents | f5d8d6124434 |
children | 745eff67ad40 |
files | service/shuttlepro/shuttlepro.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/service/shuttlepro/shuttlepro.py Mon Oct 07 23:07:34 2013 -0700 +++ b/service/shuttlepro/shuttlepro.py Tue Oct 08 21:39:06 2013 -0700 @@ -358,12 +358,15 @@ reasoning = restkit.Resource("http://bang:9071/", timeout=1) from rdflib import Namespace, Graph, Literal -SHUTTLEPRO = Namespace("http://projects.bigasterisk.com/room/livingRoom/shuttlepro/") +SHUTTLEPRO = Namespace("http://bigasterisk.com/room/livingRoom/shuttlepro/") ROOM = Namespace("http://projects.bigasterisk.com/room/") if __name__ == '__main__': import restkit reasoning = restkit.Resource("http://bang:9071/", timeout=1) + + # this should serve a graph of the current state as well, not just all oneshots + def ev(what): print 'ev', what g = Graph() @@ -380,10 +383,11 @@ ROOM['clockwise'] if what['dial'] == 1 else ROOM['counterclockwise'])) try: + nt = g.serialize(format='nt') reasoning.post( "oneShot", - payload=g.serialize(format='nt'), - headers={'Content-Type': 'text/n3'} + payload=nt, + headers={'Content-Type': 'text/n3'}, ).body_string() except restkit.errors.RequestTimeout, e: log.error(e)