-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Add color_mode support to yeelight light #51973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add color_mode support to yeelight light #51973
Conversation
@rytilahti , @zewelor , @shenxn Please help to review this |
|
||
return (hue / 360 * 65536, sat / 100 * 255) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conversion seems wrong; Home Assistant expects hue in the range 0..360, not 0..65536 and a saturation in the range 0..100, not 0..255.
Since yeelight uses the same ranges, no conversion should be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Alas, It's been such a long time since I touched this code that I cannot give much feedback here :-(
I went and tested the PR on my setup and everything seems to be working fine; the active color mode is displayed correctly, and both color & temperature controls work with yeelink.light.color1
as expected. I did not test the scene support nor any of the services, just played around a bit with the UI. I also verified that the HS mode is correctly displayed by activating it using yeecli
(there is no way to control this homeassistant, I suppose?).
Proposed change
Add
color_mode
support to yeelight lightThe driver is to fix scene support as reported here: #46341
Also fix a bug related to translation between HS color from the yeelight API and HS color in Home Assistant's format
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: