X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=inject_presence.py;fp=inject_presence.py;h=0000000000000000000000000000000000000000;hp=22ea604c3109bdd48940d633f648c102e1602c52;hb=c775b5528f8f96e75c28264b9cea8525c6da9298;hpb=a87c91b7d4544703879b7ef6e472b863765e3949 diff --git a/inject_presence.py b/inject_presence.py deleted file mode 100755 index 22ea604..0000000 --- a/inject_presence.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -from __future__ import with_statement -import zmq.utils.jsonapi as json -import zmq -import time - -######## r3 ZMQ ############ - -def sendR3Message(socket, structname, datadict): - socket.send_multipart([structname, json.dumps(datadict)]) - -#Start zmq connection to publish / forward sensor data -zmqctx = zmq.Context() -zmqctx.linger = 0 -zmqpub = zmqctx.socket(zmq.PUB) -zmqpub.connect("tcp://torwaechter.realraum.at:4243") - -time.sleep(5) -#listen for sensor data and forward them -sendR3Message(zmqpub,"PresenceUpdate",{"Present":True,"Ts":int(time.time())}) - -zmqpub.close() -zmqctx.destroy() - -