Animation thread wrapped in a try-except to prevent the thread from exiting in case of temporary errors
This commit is contained in:
parent
61e211ee07
commit
6ebab5de25
1 changed files with 19 additions and 15 deletions
|
@ -502,6 +502,7 @@ class LightHuePlugin(LightPlugin):
|
||||||
(duration and time.time() - animation_start_time > duration):
|
(duration and time.time() - animation_start_time > duration):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
try:
|
||||||
if animation == self.Animation.COLOR_TRANSITION:
|
if animation == self.Animation.COLOR_TRANSITION:
|
||||||
for (light, attrs) in lights.items():
|
for (light, attrs) in lights.items():
|
||||||
self.logger.info('Setting {} to {}'.format(light, attrs))
|
self.logger.info('Setting {} to {}'.format(light, attrs))
|
||||||
|
@ -519,6 +520,9 @@ class LightHuePlugin(LightPlugin):
|
||||||
|
|
||||||
stop_animation = _should_stop()
|
stop_animation = _should_stop()
|
||||||
if stop_animation: break
|
if stop_animation: break
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.warning(e)
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
lights = _next_light_attrs(lights)
|
lights = _next_light_attrs(lights)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue