From 14d9a7f650f0a1bb0b310b3264cee3cfd5fa0e03 Mon Sep 17 00:00:00 2001 From: Snapcase Date: Sat, 17 Aug 2019 14:13:52 -0400 Subject: [PATCH] . --- script.service.hue/addon.xml | 2 +- script.service.hue/menu.py | 18 ++++++++++-------- .../resources/lib/colorgram/colorgram.py | 2 +- script.service.hue/resources/lib/kodiHue.py | 9 ++++----- script.service.hue/service.py | 16 +++++++++------- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/script.service.hue/addon.xml b/script.service.hue/addon.xml index 838b579f..64bca7ec 100644 --- a/script.service.hue/addon.xml +++ b/script.service.hue/addon.xml @@ -1,4 +1,4 @@ - + diff --git a/script.service.hue/menu.py b/script.service.hue/menu.py index 49c40ab1..c3fdeda3 100644 --- a/script.service.hue/menu.py +++ b/script.service.hue/menu.py @@ -8,14 +8,16 @@ kodilogging.config() logger = logging.getLogger(globals.ADDONID) -if globals.DEBUG: - try: - import sys;sys.path.append("e:\dev\pysrc") - import pydevd - pydevd.settrace('localhost', stdoutToServer=False, stderrToServer=False, suspend=globals.REMOTE_DBG_SUSPEND, - trace_only_current_thread=False, overwrite_prev_trace=True, patch_multiprocessing=True) - except ImportError: - logger.exception("Kodi Hue Remote Debug Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH, or disable DEBUG") +#=============================================================================== +# if globals.DEBUG: +# try: +# import sys;sys.path.append("e:\dev\pysrc") +# import pydevd +# pydevd.settrace('localhost', stdoutToServer=False, stderrToServer=False, suspend=globals.REMOTE_DBG_SUSPEND, +# trace_only_current_thread=False, overwrite_prev_trace=True, patch_multiprocessing=True) +# except ImportError: +# logger.exception("Kodi Hue Remote Debug Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH, or disable DEBUG") +#=============================================================================== logger.info("Starting default.py, version {}, Kodi: {}".format(globals.ADDONVERSION, globals.KODIVERSION )) try: diff --git a/script.service.hue/resources/lib/colorgram/colorgram.py b/script.service.hue/resources/lib/colorgram/colorgram.py index 485766f6..282b79fb 100644 --- a/script.service.hue/resources/lib/colorgram/colorgram.py +++ b/script.service.hue/resources/lib/colorgram/colorgram.py @@ -107,7 +107,7 @@ def _process(samples,pixels,x,y,top_two_bits): samples[packed + 1] += g samples[packed + 2] += b samples[packed + 3] += 1 - return samples + return def pick_used(samples): used = [] diff --git a/script.service.hue/resources/lib/kodiHue.py b/script.service.hue/resources/lib/kodiHue.py index a35c776b..48ceaefd 100644 --- a/script.service.hue/resources/lib/kodiHue.py +++ b/script.service.hue/resources/lib/kodiHue.py @@ -278,7 +278,6 @@ def configureScene(bridge,kGroupID,action): #group0_startSceneID globals.ADDON.setSettingString("group{}_{}SceneID".format(kGroupID, action),scene[0]) globals.ADDON.setSettingString("group{}_{}SceneName".format(kGroupID,action), scene[1]) - globals.ADDON.openSettings() @@ -288,10 +287,10 @@ def configureAmbiLights(bridge,kGroupID): colorLights=[] if lights is not None: for L in lights: - gamut = getLightGamut(bridge, L) - if gamut == "A" or gamut== "B" or gamut == "C": #defaults to C if unknown model - lightNames.append(_getLightName(bridge,L)) - colorLights.append(L) + #gamut = getLightGamut(bridge, L) + #if gamut == "A" or gamut== "B" or gamut == "C": #defaults to C if unknown model + lightNames.append(_getLightName(bridge,L)) + colorLights.append(L) globals.ADDON.setSettingString("group{}_Lights".format(kGroupID),','.join(colorLights)) globals.ADDON.setSettingString("group{}_LightNames".format(kGroupID),','.join(lightNames)) diff --git a/script.service.hue/service.py b/script.service.hue/service.py index fc6dd4ef..a3617e67 100644 --- a/script.service.hue/service.py +++ b/script.service.hue/service.py @@ -8,13 +8,15 @@ kodilogging.config() logger = logging.getLogger(globals.ADDONID) -if globals.DEBUG: - try: - import pydevd - pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True, suspend=False, - trace_only_current_thread=False, overwrite_prev_trace=False, patch_multiprocessing=False) - except ImportError: - logger.exception("Kodi Hue Remote Debug Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH, or disable DEBUG") +#=============================================================================== +# if globals.DEBUG: +# try: +# import pydevd +# pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True, suspend=False, +# trace_only_current_thread=False, overwrite_prev_trace=False, patch_multiprocessing=False) +# except ImportError: +# logger.exception("Kodi Hue Remote Debug Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH, or disable DEBUG") +#=============================================================================== logger.info("Starting service.py, version {}, Kodi: {}".format(globals.ADDONVERSION, globals.KODIVERSION)) try: