diff --git a/script.service.hue/addon.xml b/script.service.hue/addon.xml index 7e125a57..01be8122 100644 --- a/script.service.hue/addon.xml +++ b/script.service.hue/addon.xml @@ -1,5 +1,5 @@ + provider-name="zim514" version="0.6.4"> diff --git a/script.service.hue/resources/lib/AmbiGroup.py b/script.service.hue/resources/lib/AmbiGroup.py index c466ddcf..fdfdafb1 100644 --- a/script.service.hue/resources/lib/AmbiGroup.py +++ b/script.service.hue/resources/lib/AmbiGroup.py @@ -159,7 +159,7 @@ def _ambiUpdate(self,cap): x = Thread(target=self._updateHueRGB,name="updateHue", args=(colors[colorIndex].rgb.r,colors[colorIndex].rgb.g,colors[colorIndex].rgb.b,L,self.transitionTime)) x.daemon = True x.start() - @timer + def _updateHueRGB(self,r,g,b,light,transitionTime): #startTime = time.time() @@ -191,7 +191,7 @@ def _updateHueRGB(self,r,g,b,light,transitionTime): #logger.debug("time: {},distance: {}".format(int((endTime-startTime)*1000),distance)) self.ambiLights[light].update(prevxy=xy) - @timer + def _updateHueXY(self,xy,light,transitionTime): #startTime = time.time() diff --git a/script.service.hue/resources/lib/globals.py b/script.service.hue/resources/lib/globals.py index 1889a48d..fe48dfc9 100644 --- a/script.service.hue/resources/lib/globals.py +++ b/script.service.hue/resources/lib/globals.py @@ -43,14 +43,14 @@ def timer(func): - """Print the runtime of the decorated function""" + """Logs the runtime of the decorated function""" @functools.wraps(func) def wrapper_timer(*args, **kwargs): + startTime = time.time() # 1 + value = func(*args, **kwargs) + endTime = time.time() # 2 + runTime = endTime - startTime # 3 if performanceLogging == True: - startTime = time.time() # 1 - value = func(*args, **kwargs) - endTime = time.time() # 2 - runTime = endTime - startTime # 3 logger.debug("[script.service.hue][{}] Completed in {:02f}ms".format(func.__name__,runTime*1000)) - return value + return value return wrapper_timer \ No newline at end of file