Closed avadiax closed 4 weeks ago
You're correct, hue
should accept a value of 0
. I've fixed this in the referenced commit.
However, I do not think the API should allow setting both color_temperature
and the hue
and saturation
pair. Whenever color_temperature
is set, hue
and saturation
seem to have no effect.
Getting the device info confirms this. hue
and saturation
will be returned as None
when set together with color_temperature
.
Thanks! Look forward to the new update.
Referring to the above code snippet in 'tapo/src/requests/set_device_info/color_light.rs' between line 65 to 92.
The code is wrong because hue must be 1 to 360, but in color_temperature and certain colors in COLOR_MAP, it is hard_coded to 0. Also, there are bulb color settings where the hue, saturation and color_temperature can co-exist such as color temperature is "3300", hue is "10", saturation is "19". Using the command:
... will always trigger a Validation error.
Please confirm if this is the case. Correct fix is that in 'fn hue_saturation', the line 'self.color_temperature' should be removed. In 'fn color_temperature', the lines 'self.hue' and 'self.saturation' should be removed.