From d1b9fef7402d02c9297be50c76664f1b2ea6fcc5 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 20 Jan 2019 00:36:07 +0100 Subject: [PATCH] Passing socket_timeout=transition_seconds attribute to _get_redis --- platypush/plugins/light/hue/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/plugins/light/hue/__init__.py b/platypush/plugins/light/hue/__init__.py index 149bd831b..ad18e4af1 100644 --- a/platypush/plugins/light/hue/__init__.py +++ b/platypush/plugins/light/hue/__init__.py @@ -660,7 +660,7 @@ class LightHuePlugin(LightPlugin): def _should_stop(): try: - redis = self._get_redis() + redis = self._get_redis(transition_seconds) redis.blpop(self.ANIMATION_CTRL_QUEUE_NAME) return True except QueueTimeoutError: @@ -723,10 +723,10 @@ class LightHuePlugin(LightPlugin): args=(lights,)) self.animation_thread.start() - def _get_redis(self): + def _get_redis(self, socket_timeout=1.0): if not self.redis: redis_args = get_backend('redis').redis_args - redis_args['socket_timeout'] = transition_seconds + redis_args['socket_timeout'] = socket_timeout self.redis = Redis(**redis_args) return self.redis