From 57af43c90c184b4d65c8ace506601c9cb3a5f7ec Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 17:52:24 +0200 Subject: [PATCH 01/15] Google API test --- speech/speech.py | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/speech/speech.py b/speech/speech.py index fa70c3c..3079987 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -1,27 +1,37 @@ import speech_recognition as sr +import io +from google.cloud import speech as sp -class sr_microphone(object): +class voiceInput(object): recognizer = sr.Recognizer() + commandFunc = None muted = True - def getInput(self): # use the object as a generator - print("Awaiting input") - if( not self.muted ): - try: - with sr.Microphone() as src: - self.recognizer.adjust_for_ambient_noise( src, duration=0.2 ) # adjust for ambient noise + def transcribe_voice( self, streamFile ): + cl = sp.SpeechClient() - audio = self.recognizer.listen(src) + with io.open( streamFile, "rb" ) as audioFile: + cont = audioFile.read() - # Make audio -> text - return (self.recognizer.recognize_google( audio )).lower() # use googles recognizer and lower its output + stream = [cont] + req = ( sp.StreamingRecognizeRequest(audio_content=chunk) for chunk in stream ) - except sr.RequestError as err: - print("Unable to request results: {0}".format(err)) + conf = sp.RecognitionConfig( + encoding = sp.RecognitionConfig.AudioEncoding.LINEAR16, + sample_rate_hertz = 16000, + language_code = "en-US" + ) - except sr.UnknownValueError as err: - print("Unknown Error: {0}".format(err)) + + streamConf = sp.StreamingRecognitionConfig(config=conf) + + responses = cl.streaming_recognize( steamConf, req ) + + for res in responses: + for result in res.results: + for alt in result.alternatives: + print(alt.transcript) def setMuted( self, setm: bool=True ): self.muted = setm @@ -30,7 +40,5 @@ class sr_microphone(object): self.setMuted( not self.muted ) -# Small test -voice = sr_microphone() -voice.setMuted(False) -print( voice.getInput() ) +vc = voiceInput() +vc.transcribe_voice( "./stream.txt" ) From a9dc7920ad5fbb82e905d8c2cfdad95694a57382 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 17:58:38 +0200 Subject: [PATCH 02/15] Removed google bloat --- speech/speech.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/speech/speech.py b/speech/speech.py index 3079987..88ae971 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -4,41 +4,11 @@ from google.cloud import speech as sp class voiceInput(object): recognizer = sr.Recognizer() - commandFunc = None muted = True - def transcribe_voice( self, streamFile ): - cl = sp.SpeechClient() - - with io.open( streamFile, "rb" ) as audioFile: - cont = audioFile.read() - - stream = [cont] - req = ( sp.StreamingRecognizeRequest(audio_content=chunk) for chunk in stream ) - - conf = sp.RecognitionConfig( - encoding = sp.RecognitionConfig.AudioEncoding.LINEAR16, - sample_rate_hertz = 16000, - language_code = "en-US" - ) - - - streamConf = sp.StreamingRecognitionConfig(config=conf) - - responses = cl.streaming_recognize( steamConf, req ) - - for res in responses: - for result in res.results: - for alt in result.alternatives: - print(alt.transcript) - def setMuted( self, setm: bool=True ): self.muted = setm def switchMute( self ): self.setMuted( not self.muted ) - - -vc = voiceInput() -vc.transcribe_voice( "./stream.txt" ) From 085d83cf613293e0004ed9823ab212458d0bbf3a Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 17:59:01 +0200 Subject: [PATCH 03/15] Removed more google bloat --- speech/speech.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/speech/speech.py b/speech/speech.py index 88ae971..970937f 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -1,6 +1,4 @@ import speech_recognition as sr -import io -from google.cloud import speech as sp class voiceInput(object): recognizer = sr.Recognizer() From 3564a5e02865786c4939dc58a8dac829208d9d3a Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 18:26:01 +0200 Subject: [PATCH 04/15] Everything costs money sadly --- speech/speech.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/speech/speech.py b/speech/speech.py index 970937f..f6926e8 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -5,8 +5,28 @@ class voiceInput(object): muted = True + def voiceToText( self, deviceIndex=30 ): + try: + with sr.Microphone( deviceIndex ) as src: + self.recognizer.adjust_for_ambient_noise( src, 0.2 ) + audio = self.recognizer.listen( src ) + text = self.recognizer.recognize_google(audio) + print(text) + + except sr.RequestError as err: + print("Unable to request results: {0}".format(err)) + + except sr.UnknownValueError as err: + print("Unknown Error: {0}".format(err)) + + def setMuted( self, setm: bool=True ): self.muted = setm def switchMute( self ): self.setMuted( not self.muted ) + + +voice = voiceInput() +voice.setMuted(False) +print( "out:", voice.voiceToText() ) From df5301d0b62b445ad8cf8600f53c17c96d8e2429 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 18:38:56 +0200 Subject: [PATCH 05/15] Added recursive listening hehe --- speech/speech.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/speech/speech.py b/speech/speech.py index f6926e8..6233e9c 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -9,10 +9,14 @@ class voiceInput(object): try: with sr.Microphone( deviceIndex ) as src: self.recognizer.adjust_for_ambient_noise( src, 0.2 ) - audio = self.recognizer.listen( src ) + print("Listening...") + audio = self.recognizer.listen( src, phrase_time_limit=5 ) + print("Thinking...") text = self.recognizer.recognize_google(audio) print(text) + return self.voiceToText(deviceIndex) + except sr.RequestError as err: print("Unable to request results: {0}".format(err)) From 1e0350d35624492383d66174ef2ceba66f8adc7c Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 18:43:08 +0200 Subject: [PATCH 06/15] Removed unneeded code --- speech/speech.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/speech/speech.py b/speech/speech.py index 6233e9c..f026911 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -19,9 +19,11 @@ class voiceInput(object): except sr.RequestError as err: print("Unable to request results: {0}".format(err)) + return self.voiceToText(deviceIndex) - except sr.UnknownValueError as err: - print("Unknown Error: {0}".format(err)) + except sr.UnknownValueError: + print("????") + return self.voiceToText(deviceIndex) def setMuted( self, setm: bool=True ): From 2ffdb41cab1cc97e4e472f9a9fed758df37e6728 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 19:08:31 +0200 Subject: [PATCH 07/15] Fixed the voice to text --- speech/speech.py | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/speech/speech.py b/speech/speech.py index f026911..1043fc8 100644 --- a/speech/speech.py +++ b/speech/speech.py @@ -5,25 +5,28 @@ class voiceInput(object): muted = True - def voiceToText( self, deviceIndex=30 ): - try: - with sr.Microphone( deviceIndex ) as src: - self.recognizer.adjust_for_ambient_noise( src, 0.2 ) - print("Listening...") - audio = self.recognizer.listen( src, phrase_time_limit=5 ) - print("Thinking...") - text = self.recognizer.recognize_google(audio) - print(text) - - return self.voiceToText(deviceIndex) - - except sr.RequestError as err: - print("Unable to request results: {0}".format(err)) - return self.voiceToText(deviceIndex) - - except sr.UnknownValueError: - print("????") - return self.voiceToText(deviceIndex) + # "Error codes", can be used to check stuff + what = "??" + error = "ERROR" + + def start( self, deviceIndex=30 ): # a generator for everything that is said + while( True ): # loop + try: + if( not self.muted ): # this thing is not the NSA + with sr.Microphone( deviceIndex ) as src: + self.recognizer.adjust_for_ambient_noise( src, 0.2 ) + print("Listening...") + audio = self.recognizer.listen( src, phrase_time_limit=5 ) + print("Thinking...") + text = self.recognizer.recognize_google(audio) + yield text + + except sr.RequestError as err: + print("Unable to request results: {0}".format(err)) + yield self.error + + except sr.UnknownValueError: + yield self.what def setMuted( self, setm: bool=True ): @@ -32,7 +35,3 @@ class voiceInput(object): def switchMute( self ): self.setMuted( not self.muted ) - -voice = voiceInput() -voice.setMuted(False) -print( "out:", voice.voiceToText() ) From 4236f52e3220ce599e96f3036d2b713d8d1f719a Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 19:23:38 +0200 Subject: [PATCH 08/15] Module fix --- modules/hue/__init__.py | 0 modules/hue/__main__.py | 0 modules/hue/config.py | 6 ++++++ {hue_remote => modules/hue}/default-config.py | 0 {hue_remote => modules/hue}/hue_controller.py | 0 {hue_remote => modules/hue}/hue_remote.py | 0 {hue_remote => modules/hue}/lib/func.py | 0 {hue_remote => modules/hue}/presets.py | 0 modules/speech/__init__.py | 0 modules/speech/__main__.py | 0 {speech => modules/speech}/speech.py | 0 speech_daemon.py | 3 +++ 12 files changed, 9 insertions(+) create mode 100644 modules/hue/__init__.py create mode 100644 modules/hue/__main__.py create mode 100644 modules/hue/config.py rename {hue_remote => modules/hue}/default-config.py (100%) rename {hue_remote => modules/hue}/hue_controller.py (100%) rename {hue_remote => modules/hue}/hue_remote.py (100%) rename {hue_remote => modules/hue}/lib/func.py (100%) rename {hue_remote => modules/hue}/presets.py (100%) create mode 100644 modules/speech/__init__.py create mode 100644 modules/speech/__main__.py rename {speech => modules/speech}/speech.py (100%) create mode 100755 speech_daemon.py diff --git a/modules/hue/__init__.py b/modules/hue/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/hue/__main__.py b/modules/hue/__main__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/hue/config.py b/modules/hue/config.py new file mode 100644 index 0000000..2328100 --- /dev/null +++ b/modules/hue/config.py @@ -0,0 +1,6 @@ +# Speech CMD settings +prefix = "computer" + +# Hue Remote Settings +address = "192.168.0.3" +username = "E0ru0AeVFKEH1E30X40JAJfovg4Uu1aTkdrKQ2Oi" diff --git a/hue_remote/default-config.py b/modules/hue/default-config.py similarity index 100% rename from hue_remote/default-config.py rename to modules/hue/default-config.py diff --git a/hue_remote/hue_controller.py b/modules/hue/hue_controller.py similarity index 100% rename from hue_remote/hue_controller.py rename to modules/hue/hue_controller.py diff --git a/hue_remote/hue_remote.py b/modules/hue/hue_remote.py similarity index 100% rename from hue_remote/hue_remote.py rename to modules/hue/hue_remote.py diff --git a/hue_remote/lib/func.py b/modules/hue/lib/func.py similarity index 100% rename from hue_remote/lib/func.py rename to modules/hue/lib/func.py diff --git a/hue_remote/presets.py b/modules/hue/presets.py similarity index 100% rename from hue_remote/presets.py rename to modules/hue/presets.py diff --git a/modules/speech/__init__.py b/modules/speech/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/speech/__main__.py b/modules/speech/__main__.py new file mode 100644 index 0000000..e69de29 diff --git a/speech/speech.py b/modules/speech/speech.py similarity index 100% rename from speech/speech.py rename to modules/speech/speech.py diff --git a/speech_daemon.py b/speech_daemon.py new file mode 100755 index 0000000..42a18ca --- /dev/null +++ b/speech_daemon.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python + +import lib.speech.speech From 5c3efe66b1fea3bd97a2edd61bd15dbe1df40201 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 19:32:16 +0200 Subject: [PATCH 09/15] Added daemon --- speech_daemon.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/speech_daemon.py b/speech_daemon.py index 42a18ca..23e4f00 100755 --- a/speech_daemon.py +++ b/speech_daemon.py @@ -1,3 +1,17 @@ #!/usr/bin/env python -import lib.speech.speech +from modules.hue.hue_remote import parseCommand +from modules.speech.speech import voiceInput + +class speech_daemon(object): + voiceInpObj = None + + def __init__(self, deviceIndex=30): + voiceInpObj = voiceInput() + + voiceInpObj.setMuted(False) + + voiceInpObj.start(deviceIndex) + +if __name__ == "__main__": + daemon = speech_daemon() From 55990fbdcc6bd1d8df25b803adf2bf9b041327b7 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 19:34:27 +0200 Subject: [PATCH 10/15] Added bugs --- modules/hue/hue_remote.py => hue_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename modules/hue/hue_remote.py => hue_remote.py (97%) diff --git a/modules/hue/hue_remote.py b/hue_remote.py similarity index 97% rename from modules/hue/hue_remote.py rename to hue_remote.py index d0bf730..3f64656 100755 --- a/modules/hue/hue_remote.py +++ b/hue_remote.py @@ -3,7 +3,7 @@ import sys -import hue_controller as hue # Actual controller +from modules.hue import hue_controller as hue # Actual controller cmd = "hue" From 86d7681f7d28fef5730f7c3147bacd891cc9f562 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 19:55:43 +0200 Subject: [PATCH 11/15] Added import errors --- hue_cmd.py | 12 ++++++++++++ modules/hue/hue_controller.py | 6 +++--- hue_remote.py => modules/hue/hue_remote.py | 8 -------- speech_daemon.py | 1 - 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100755 hue_cmd.py rename hue_remote.py => modules/hue/hue_remote.py (93%) diff --git a/hue_cmd.py b/hue_cmd.py new file mode 100755 index 0000000..73e8793 --- /dev/null +++ b/hue_cmd.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +from modules.hue.hue_controller import controller +from modules.hue.hue_remote import parseCommandline + +def init(): + hue.controller.init() # very important to initialize the controller + parseCommandline() + hue.controller.end() # also to end it + +if __name__ == "__main__": + init() diff --git a/modules/hue/hue_controller.py b/modules/hue/hue_controller.py index 20bd133..2cbbd14 100644 --- a/modules/hue/hue_controller.py +++ b/modules/hue/hue_controller.py @@ -3,10 +3,10 @@ import json # API uses JSON import asyncio # ASync stuff import time -from lib.func import * # useful functions +from .lib.func import * # useful functions -import config # Configuration for the controller (/config.py <- change this file) -from presets import * # presets for the lights +#import .config as config # Configuration for the controller (/config.py <- change this file) +from .presets import * # presets for the lights LIGHTS = {} # dictionary of all the lights diff --git a/hue_remote.py b/modules/hue/hue_remote.py similarity index 93% rename from hue_remote.py rename to modules/hue/hue_remote.py index 3f64656..5ce5763 100755 --- a/hue_remote.py +++ b/modules/hue/hue_remote.py @@ -97,11 +97,3 @@ def parseCommandline(): parseCommand( cmd, 2 ) else: help() - - -def init(): - hue.controller.init() # very important to initialize the controller - parseCommandline() - hue.controller.end() # also to end it - -init() # actually call the init function diff --git a/speech_daemon.py b/speech_daemon.py index 23e4f00..55b240c 100755 --- a/speech_daemon.py +++ b/speech_daemon.py @@ -8,7 +8,6 @@ class speech_daemon(object): def __init__(self, deviceIndex=30): voiceInpObj = voiceInput() - voiceInpObj.setMuted(False) voiceInpObj.start(deviceIndex) From eaa72ef06bb734606d92233544e208275dec0c99 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 20:12:54 +0200 Subject: [PATCH 12/15] Made the daemon wrok --- modules/hue/hue_remote.py | 14 +++++++------- speech_daemon.py | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/modules/hue/hue_remote.py b/modules/hue/hue_remote.py index 5ce5763..b97cb97 100755 --- a/modules/hue/hue_remote.py +++ b/modules/hue/hue_remote.py @@ -31,7 +31,7 @@ boolConvert = { # this is the most spaghetti-ish code I have ever written but it works -def parseCommand( cmd:list, pos:int, i=-1 ): +def parseCommand( cmd:list, pos:int, i=-1, displayHelp=True ): index = int(i) try: if( cmd[pos] == "on" or cmd[pos] == "off" ): @@ -82,18 +82,18 @@ def parseCommand( cmd:list, pos:int, i=-1 ): help() # display help if function did nothing except (RuntimeError, TypeError, NameError, IndexError) as err: - help() # display the help page if parameters are missing (it will give out an IndexError) - print( "\n\nError: " + str(err) ) + if(displayHelp): + help() # display the help page if parameters are missing (it will give out an IndexError) + print( "\n\nError: " + str(err) ) -def parseCommandline(): - cmd = sys.argv +def parseCommandline( cmd=sys.argv, needHelp=True ): if( len(cmd) > 1 ): if( cmd[1] == "light" ): - parseCommand( cmd, 3, cmd[2] ) + parseCommand( cmd, 3, cmd[2], displayHelp=needHelp ) elif( cmd[1] == "lights" ): - parseCommand( cmd, 2 ) + parseCommand( cmd, 2, displayHelp=needHelp ) else: help() diff --git a/speech_daemon.py b/speech_daemon.py index 55b240c..896744b 100755 --- a/speech_daemon.py +++ b/speech_daemon.py @@ -1,16 +1,26 @@ #!/usr/bin/env python -from modules.hue.hue_remote import parseCommand +from modules.hue.hue_remote import parseCommandline from modules.speech.speech import voiceInput +prefixes = ["computer", "computers"] + class speech_daemon(object): voiceInpObj = None def __init__(self, deviceIndex=30): - voiceInpObj = voiceInput() - voiceInpObj.setMuted(False) + self.voiceInpObj = voiceInput() + self.voiceInpObj.setMuted(False) - voiceInpObj.start(deviceIndex) + def start(self): + return self.voiceInpObj.start() 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 ) From 2cdef57b4fbae45727d224971f96a917f10c43e0 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 20:39:35 +0200 Subject: [PATCH 13/15] Finished speech daemon --- hue_cmd.py | 4 ++-- modules/hue/config.py | 8 +++----- modules/hue/hue_controller.py | 4 ++-- modules/hue/hue_remote.py | 6 +++--- speech_daemon.py | 19 +++++++++++-------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/hue_cmd.py b/hue_cmd.py index 73e8793..8a048b9 100755 --- a/hue_cmd.py +++ b/hue_cmd.py @@ -4,9 +4,9 @@ from modules.hue.hue_controller import controller from modules.hue.hue_remote import parseCommandline def init(): - hue.controller.init() # very important to initialize the controller + controller.init() # very important to initialize the controller parseCommandline() - hue.controller.end() # also to end it + controller.end() # also to end it if __name__ == "__main__": init() diff --git a/modules/hue/config.py b/modules/hue/config.py index 2328100..6e7119e 100644 --- a/modules/hue/config.py +++ b/modules/hue/config.py @@ -1,6 +1,4 @@ -# Speech CMD settings -prefix = "computer" - # Hue Remote Settings -address = "192.168.0.3" -username = "E0ru0AeVFKEH1E30X40JAJfovg4Uu1aTkdrKQ2Oi" +class hue_config: + address = "192.168.0.3" + username = "E0ru0AeVFKEH1E30X40JAJfovg4Uu1aTkdrKQ2Oi" diff --git a/modules/hue/hue_controller.py b/modules/hue/hue_controller.py index 2cbbd14..629fd1e 100644 --- a/modules/hue/hue_controller.py +++ b/modules/hue/hue_controller.py @@ -5,7 +5,7 @@ import time from .lib.func import * # useful functions -#import .config as config # Configuration for the controller (/config.py <- change this file) +from .config import * # Configuration for the controller (/config.py <- change this file) from .presets import * # presets for the lights LIGHTS = {} # dictionary of all the lights @@ -13,7 +13,7 @@ LIGHTS = {} # dictionary of all the lights loop = asyncio.get_event_loop() # ASync loop def genUrl(params: str): - return "http://" + config.address + "/api/" + config.username + params + return "http://" + hue_config.address + "/api/" + hue_config.username + params class APIrequest: # Get Req diff --git a/modules/hue/hue_remote.py b/modules/hue/hue_remote.py index b97cb97..46e890f 100755 --- a/modules/hue/hue_remote.py +++ b/modules/hue/hue_remote.py @@ -31,8 +31,7 @@ boolConvert = { # this is the most spaghetti-ish code I have ever written but it works -def parseCommand( cmd:list, pos:int, i=-1, displayHelp=True ): - index = int(i) +def parseCommand( cmd:list, pos:int, index=-1, displayHelp=True ): try: if( cmd[pos] == "on" or cmd[pos] == "off" ): if( index == -1 ): @@ -94,6 +93,7 @@ def parseCommandline( cmd=sys.argv, needHelp=True ): parseCommand( cmd, 3, cmd[2], displayHelp=needHelp ) elif( cmd[1] == "lights" ): + print("gothere1") parseCommand( cmd, 2, displayHelp=needHelp ) - else: + elif( needHelp ): help() diff --git a/speech_daemon.py b/speech_daemon.py index 896744b..f2f7a01 100755 --- a/speech_daemon.py +++ b/speech_daemon.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from modules.hue.hue_remote import parseCommandline +from modules.hue.hue_controller import controller from modules.speech.speech import voiceInput prefixes = ["computer", "computers"] @@ -13,14 +14,16 @@ class speech_daemon(object): self.voiceInpObj.setMuted(False) def start(self): - return self.voiceInpObj.start() + controller.init() + + for inp in self.voiceInpObj.start(): + cmdBuf = inp.lower().split(" ") + if( cmdBuf[0] in prefixes ): + print("CMD:", cmdBuf) + parseCommandline( cmdBuf, False ) + + controller.end() 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 ) + daemon.start() From 50a592986d02474881e422ae9c4cada01966d149 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 20:40:35 +0200 Subject: [PATCH 14/15] Removed small debug code --- modules/hue/hue_remote.py | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hue/hue_remote.py b/modules/hue/hue_remote.py index 46e890f..fc81abd 100755 --- a/modules/hue/hue_remote.py +++ b/modules/hue/hue_remote.py @@ -93,7 +93,6 @@ def parseCommandline( cmd=sys.argv, needHelp=True ): parseCommand( cmd, 3, cmd[2], displayHelp=needHelp ) elif( cmd[1] == "lights" ): - print("gothere1") parseCommand( cmd, 2, displayHelp=needHelp ) elif( needHelp ): help() From 5b13d7a7da0f2dbd876c6df9e1e6200d60952a5c Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 6 Oct 2020 20:44:40 +0200 Subject: [PATCH 15/15] Updated config --- modules/hue/default-config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/hue/default-config.py b/modules/hue/default-config.py index 372cacb..db1a6ba 100644 --- a/modules/hue/default-config.py +++ b/modules/hue/default-config.py @@ -2,5 +2,7 @@ # RENAME THIS FILE TO "config.py"# ################################## -address = "" -username = "" +# Hue Remote Settings +class hue_config: + address = "" # Local IPv4 address to the HUE bridge + username = "" # Username for the bridge