Skip to content

Commit

Permalink
fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Snapcase committed Jul 16, 2019
1 parent 10cd79b commit 2b418ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions script.service.hue/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<addon id="script.service.hue" name="Hue Service"
provider-name="zim514" version="0.6.6">
provider-name="zim514" version="0.6.7">

<requires>
<import addon="xbmc.python" version="2.26.0" />
Expand All @@ -24,7 +24,7 @@
<summary lang="en_GB">Automate Hue lights with Kodi playback</summary>
<description lang="en_GB">Automate your Philips Hue lights with Kodi. Create multi-room scenes that run when you Play, Pause or Stop media playback. Create and delete multi-room scenes from add-on settings then select which to apply for different Playback events. Can use Hue's sunrise and sunset times to automatically disable the service during daytime and turn on the lights at sunset during playback. Includes experimental Ambilight support. Check forum for more information.</description>
<disclaimer lang="en_GB">Automate Hue lights with Kodi playback</disclaimer>
<news>v0.6.6:
<news>v0.6.7:
- Change some ambilight default settings to better values
- Change Hue NuPNP Discovery URL until SSL chain is fixed by Philips
- Fix Hue username not saving properly
Expand Down
5 changes: 3 additions & 2 deletions script.service.hue/resources/lib/AmbiGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ def setup(self, monitor,bridge, kgroupID, flash=False, mediaType=VIDEO):
super(AmbiGroup,self).setup(bridge, kgroupID, flash=flash, mediaType=1)

self.monitor=monitor
calls=0

try:
calls=0
calls=1/(self.updateInterval)*len(self.ambiLights) #updateInterval is in seconds, eg. 0.2 for 200ms.
if calls > 25:
kodiutils.notification(_("Hue Service"), _("Est. Hue Commands/sec (max 20): {}").format(calls),time=000,icon=NOTIFICATION_WARNING)
except ZeroDivisionError:
except Exception:
kodiutils.notification(_("Hue Service"), _("Recommended minimum update interval: 100ms").format(calls),time=5000,icon=NOTIFICATION_WARNING)
logger.debug("callsPerSec: lights: {},interval: {}, calls: {}".format(len(self.ambiLights),self.updateInterval,calls))

Expand Down

0 comments on commit 2b418ce

Please sign in to comment.