From 54a8c761a6d23b07ea8cd9e3299f12ec1aa512e7 Mon Sep 17 00:00:00 2001
From: "E. Almqvist" <h1g.server@gmail.com>
Date: Tue, 6 Oct 2020 19:55:43 +0200
Subject: [PATCH] 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)