Implemented retry mechanism

This commit is contained in:
Fabio Manganiello 2017-12-11 04:45:55 +01:00
parent ab9e86dc25
commit b4c445ecec
1 changed files with 6 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import logging
import time
from phue import Bridge
@ -68,6 +69,11 @@ class LightHuePlugin(LightPlugin):
logging.exception(e)
# Reset bridge connection
self.bridge = None
if 'is_retry' not in kwargs:
time.sleep(1)
self._execute(attr, is_retry=True, *args, **kwargs)
return
lights = []; groups = []