zha: fix 0 second transitions being ignored. (#26654)

Allow turning a light on instantly, with no transition time.
This is actually required for IKEA lights to be able to set brightness
and color temp in a single call.
This commit is contained in:
Abílio Costa 2019-09-16 12:14:05 +01:00 committed by David F. Mulcahey
parent db48d5effd
commit 8de84c53a1

View File

@ -201,7 +201,7 @@ class Light(ZhaEntity, light.Light):
async def async_turn_on(self, **kwargs):
"""Turn the entity on."""
transition = kwargs.get(light.ATTR_TRANSITION)
duration = transition * 10 if transition else DEFAULT_DURATION
duration = transition * 10 if transition is not None else DEFAULT_DURATION
brightness = kwargs.get(light.ATTR_BRIGHTNESS)
effect = kwargs.get(light.ATTR_EFFECT)