Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Snapcase committed Aug 17, 2019
1 parent 6764d74 commit 14d9a7f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion script.service.hue/addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="script.service.hue" name="Hue Service" provider-name="zim514" version="0.7.9">
<addon id="script.service.hue" name="Hue Service" provider-name="zim514" version="0.7.10~dev2">
<requires>
<import addon="xbmc.python" version="2.26.0" />
<import addon="script.module.requests" version="2.22.0" />
Expand Down
18 changes: 10 additions & 8 deletions script.service.hue/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion script.service.hue/resources/lib/colorgram/colorgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
9 changes: 4 additions & 5 deletions script.service.hue/resources/lib/kodiHue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand All @@ -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))
Expand Down
16 changes: 9 additions & 7 deletions script.service.hue/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 14d9a7f

Please sign in to comment.