PaulAnnekov / tuyaha

Implements the special Tuya Home Assistant API.
Other
142 stars 106 forks source link

Extend Light to set color to a real white #33

Closed xremix closed 4 years ago

xremix commented 4 years ago

Hi,

this function with these little hardcoded values will allow to set a bulb to real white, which is sometimes brighter than just disabling the saturation.

Thanks Toni

Faboor commented 4 years ago

Is this actually required for your devices? The only difference I see between your PR and current set_color implementation is that it forces brightness to be 100 instead of it being current brightness (scaled to [0..1]) or whatever specified.

Actually, what I see is that if I use set_color(("anything", 0, x)) then if

xremix commented 4 years ago

@Faboor the idea was to have a small handy helper function, that helps people understand how to set the color to white mode. Indeed this is just forcing the brightness and color, but this will help people understand how the API works and ease things. If this doesn't make sense as part of the project let me know.

PaulAnnekov commented 4 years ago

I think it's better to add some comment regarding "white mode" and not creating a new function. Feel free to create a new PR.