From b9cf4df557df9fe365d52c8bd5e2ad8779866730 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Thu, 9 Mar 2017 22:50:30 +0100 Subject: [PATCH] Increase upper limit on light transitions (#2843) This increases the global limit to 6535 seconds (1h48m55s) because that is supported by all light platforms. Some platforms support even longer transition times so the limit should actually be platform specific. --- homeassistant/components/light/__init__.py | 2 +- homeassistant/components/light/hue.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 502620eb362..a5e4b87185e 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -86,7 +86,7 @@ PROP_TO_ATTR = { } # Service call validation schemas -VALID_TRANSITION = vol.All(vol.Coerce(float), vol.Clamp(min=0, max=900)) +VALID_TRANSITION = vol.All(vol.Coerce(float), vol.Clamp(min=0, max=6553)) VALID_BRIGHTNESS = vol.All(vol.Coerce(int), vol.Clamp(min=0, max=255)) LIGHT_TURN_ON_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/light/hue.py b/homeassistant/components/light/hue.py index 09444ee5765..fa215cf69bb 100644 --- a/homeassistant/components/light/hue.py +++ b/homeassistant/components/light/hue.py @@ -436,12 +436,7 @@ class HueLight(Light): command = {'on': False} if ATTR_TRANSITION in kwargs: - # Transition time is in 1/10th seconds and cannot exceed - # 900 seconds. - command['transitiontime'] = min( - 9000, - int(kwargs[ATTR_TRANSITION] * 10) - ) + command['transitiontime'] = int(kwargs[ATTR_TRANSITION] * 10) flash = kwargs.get(ATTR_FLASH)