fix some stuff

This commit is contained in:
chrys 2018-09-07 01:03:55 +02:00
parent 69ffffc7a4
commit 50b6c0761c

View File

@ -6,24 +6,22 @@
''' '''
Remote controll: Remote controll:
start delimiter = #<=># section<space>command<space>parameters
category=settings,command sections:command,setting
setting actions: setting commands:
- set (Parameter = settings) - set section#setting=value[,section#setting=value]
- reset - reset
command actions: command commands:
- exec (Parameter1 = Command, Parameter2 = Command Parameters) - say text to speech
- cancel - interrupt
structure: examples
#<=>#category##action[##Parameter1##Parameter2]
settings: settings:
#<=>#settings##set##section#setting=value[,section#setting=value] settings set section#setting=value[,section#setting=value]
#<=>#settings##set##speech#voice=de setting set speech#voice=de
#<=>#settings##reset setting reset
execute command: command:
#<=>#command##exec#say##this is a test command say this is a test
#<=>#command##cancel##say command interrupt
''' '''
@ -84,7 +82,6 @@ class remoteManager():
self.sock = None self.sock = None
def tcpWatchDog(self, active, eventQueue): def tcpWatchDog(self, active, eventQueue):
# echo "command say this is a test" | nc localhost 22447 # echo "command say this is a test" | nc localhost 22447
# port should be configureable
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.host = '0.0.0.0' self.host = '0.0.0.0'
@ -139,14 +136,6 @@ class remoteManager():
def handleRemoteIncomming(self, eventData): def handleRemoteIncomming(self, eventData):
if not eventData: if not eventData:
return return
# examples
# settings:
# settings set section#setting=value[,section#setting=value]
# setting set speech#voice=de
# setting reset
# execute command:
# command say this is a test
# command interrupt
if eventData.startswith('setting '): if eventData.startswith('setting '):
settingsText = eventData[len('setting '):] settingsText = eventData[len('setting '):]
self.handleSettingsChange(settingsText) self.handleSettingsChange(settingsText)