projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d76607
)
add button
author
Bernhard Tittelbach
<xro@realraum.at>
Sun, 6 Oct 2013 21:18:27 +0000
(21:18 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Sun, 6 Oct 2013 21:18:27 +0000
(21:18 +0000)
bridge-old-sensors-zmq.py
patch
|
blob
|
history
diff --git
a/bridge-old-sensors-zmq.py
b/bridge-old-sensors-zmq.py
index
016c495
..
65e5bc9
100755
(executable)
--- a/
bridge-old-sensors-zmq.py
+++ b/
bridge-old-sensors-zmq.py
@@
-142,7
+142,8
@@
def trackSensorStatus(uwscfg, zmqsocket):
global sshp, tracksensor_running
RE_TEMP = re.compile(r'temp(\d): (\d+\.\d+)')
RE_PHOTO = re.compile(r'photo(\d): [^0-9]*?(\d+)',re.I)
global sshp, tracksensor_running
RE_TEMP = re.compile(r'temp(\d): (\d+\.\d+)')
RE_PHOTO = re.compile(r'photo(\d): [^0-9]*?(\d+)',re.I)
- RE_MOVEMENT = re.compile(r'movement|button\d?|PanicButton',re.I)
+ RE_MOVEMENT = re.compile(r'movement',re.I)
+ RE_BUTTON = re.compile(r'button\d?|PanicButton',re.I)
RE_ERROR = re.compile(r'Error: (.+)',re.I)
while tracksensor_running:
uwscfg.checkConfigUpdates()
RE_ERROR = re.compile(r'Error: (.+)',re.I)
while tracksensor_running:
uwscfg.checkConfigUpdates()
@@
-170,6
+171,10
@@
def trackSensorStatus(uwscfg, zmqsocket):
if len(line) < 1:
raise Exception("EOF on Subprocess, daemon seems to have quit, returncode: %d",sshp.returncode)
logging.debug("trackSensorStatus: Got Line: " + line)
if len(line) < 1:
raise Exception("EOF on Subprocess, daemon seems to have quit, returncode: %d",sshp.returncode)
logging.debug("trackSensorStatus: Got Line: " + line)
+ m = RE_BUTTON.match(line)
+ if not m is None:
+ sendR3Message(zmqsocket, "BoreDoomButtonPressEvent", {"Ts":int(time.time())})
+ continue
m = RE_MOVEMENT.match(line)
if not m is None:
sendR3Message(zmqsocket, "MovementSensorUpdate", {"Sensorindex":0, "Ts":int(time.time())})
m = RE_MOVEMENT.match(line)
if not m is None:
sendR3Message(zmqsocket, "MovementSensorUpdate", {"Sensorindex":0, "Ts":int(time.time())})