Fix KNX rgb(w) color (again)#51060
Conversation
|
Hey there @Julius2342, @marvin-w, mind taking a look at this pull request as its been labeled with an integration ( |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
@spacegaier I think you have tested this. Shall we use it or close it? |
|
Hi, how to test this? |
|
Docker makes this more complicated. If you have mounted it as volume it may do the trick. Else it will not persist these changes after a container restart (which you need to load it). You can inspect the code in the running container from a shell or just add some If it is loaded at least one of the rgb colors should always be 255 in developer tools -> states. At least that was the intention. |
|
I did not find anyone to test this on a live system, but I still think it should be the way to go. |
|
Considering how many branches there are here, it would be good to have some tests for this so it doesn't cause regressions for other light types. |
|
I'm just working on writing tests for the knx light module... will take some time - so many possible configurations 🤪 |
|
Done. I'll rebase this when #58912 is merged. |
|
Looks like a flaky test: https://github.com/home-assistant/core/runs/4216637595?check_suite_focus=true |
|
Actually it's more than flaky: it fails everytime on my machine: |
|
I guess this is a side effect from the library bump. On it. |
* calculate brightness from color; scale color * fix merge * fix sending color only for brightness independent rgb color * fix tests for rgb and rgbw color * use public match_max_scale
Proposed change
Calculate master brightness from color and scale up color.
As HA treats RGB as 4-channel Light (red, green, blue, brightness) we have to fake the KNX 3-channel RGB color to have brightness not applied twice. Same for RGBW.
At least I think this is how it should work. I don't have any colored lights so I can't test this live. Would be nice if anyone could test this with an actual actuator.
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: