CLI tool to control your IoT gadgets.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
roomcomputer/speech_daemon.py

27 lines
597 B

4 years ago
#!/usr/bin/env python
from modules.hue.hue_remote import parseCommandline
4 years ago
from modules.speech.speech import voiceInput
prefixes = ["computer", "computers"]
4 years ago
class speech_daemon(object):
voiceInpObj = None
def __init__(self, deviceIndex=30):
self.voiceInpObj = voiceInput()
self.voiceInpObj.setMuted(False)
4 years ago
def start(self):
return self.voiceInpObj.start()
4 years ago
if __name__ == "__main__":
daemon = speech_daemon()
cmdBuf = None
for inp in daemon.start():
cmdBuf = inp.lower().split(" ")
if( cmdBuf[0] in prefixes ):
print("CMD:", cmdBuf)
parseCommandline( cmdBuf[1:], False )