Adding support for a white value #3338
Conversation
addedattribute "WHITE_VALUE" to improve support for RGBW devices
shortened line
|
Please forgive my ignorance here, but what is the difference between what you've added and the color temperature setting (also in mireds)? |
|
My fault. I actually forget to change the description. Some lights allow 4 channels (red, green, blue, white) to be controlled at the same time. So this is the the white component from 0 to 255. |
|
Looks good! I'll use this for mysensors. |
|
Add tests that test the function and service and use When that is done this should be good to go. |
|
I'm not familiar with testing and therefore have absolutely no idea what I'm supposed to do. :( |
|
I would prefer to only add this if it includes a platform that is using this method. You should also add it to the demo light so we are able to test the UI part. And tests like @MartinHjelmare mentioned. |
|
@mxtra If you like, we could team up on this and I could help with tests and add the feature to the mysensors platform. Let me know if that's OK and if I can push to your fork branch. I'll have time over the weekend. |
|
@MartinHjelmare I think that is an excellent idea. I would really appreciate your help! |
|
Great! You can PM me on gitter if you want also. What's your timezone? I'm CET. |
|
I'm in Germany, so it's CET as well. :) I'll reach out to you when I come home tonight. |
* Activate support for mysensors RGBW devices with support for white_value attribute. * Add white_value support in light demo platform. * Add tests for white_value and more for light component. * Add tests for light demo platform. * Fix import order in check_config.
|
Backend should be ok now. I haven't tested the frontend yet. |
|
I guess we need to rebase off dev to have accurate coverage results. The changes I've made should be covered by new tests or excluded in case of mysensors, via coveragerc. |
|
The coverage results are accurate, due to asyncio we have dropped to 93.6. We'll fix that soon ;-) |
|
Code looks good 👍 What's the difference between brightness and white value? |
|
Brightness is a general term for the "power" of a light, for one or many channels. Some devices control all channels at the same time with a brightness control, others control RGB separately from W. To be able to control only the W channel and support all device types, we need a parameter for White that is separate from Brightness. |
|
🐬 |
I'm quite new to GitHub, so please don't roast me. :)
Description:
Adding support for a white value to improve controlling of RGBW-lights that allow to set each channel independently.
This was done by simply copying the code for the color temp functionality but setting the range from 0 to 255.
There is also one file in the frontend that has to be changed. home-assistant/frontend#105
Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass