From b4c445ecec833742a46dfb36fd129a0d4d0597ca Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 11 Dec 2017 04:45:55 +0100 Subject: [PATCH] Implemented retry mechanism --- runbullet/plugins/light/hue/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runbullet/plugins/light/hue/__init__.py b/runbullet/plugins/light/hue/__init__.py index 933c0413b5..b33e97193c 100644 --- a/runbullet/plugins/light/hue/__init__.py +++ b/runbullet/plugins/light/hue/__init__.py @@ -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 = []