deconz: fix light.turn_off with transition (#15222)

When light.turn_off is invoked with a transition, the following payload was
sent to deCONZ via PUT to /light/N/state:

{ "bri": 0, "transitiontime": transition }

However, on recent versions of deCONZ (latest is 2.05.31 at the time of
writing) this does not turn off the light, just sets it to minimum brightness
level (brightness is clamped to minimum level the light supports without
turning it off).

This commit makes the code send this payload instead:

{ "on": false, "transitiontime": transition }

This works as intended and the light does transition to the 'off' state.
This change was tested with Philips Hue colored lights, IKEA colored lights
and IKEA white spectrum lights: they were all able to be turned off
successfully with the new payload, and none of them could be turned off with
the old payload.
This commit is contained in:
Leonardo Brondani Schenkel 2018-06-30 00:59:10 +02:00 committed by Robert Svensson
parent 24fec3e826
commit 10d1e81f10

View file

@ -174,7 +174,6 @@ class DeconzLight(Light):
data = {'on': False}
if ATTR_TRANSITION in kwargs:
data = {'bri': 0}
data['transitiontime'] = int(kwargs[ATTR_TRANSITION]) * 10
if ATTR_FLASH in kwargs: