Fix KNX light: turn on color light with only brightness#50979
Fix KNX light: turn on color light with only brightness#50979emontnemery merged 5 commits intohome-assistant:devfrom
Conversation
|
Hey there @Julius2342, @marvin-w, mind taking a look at this pull request as its been labeled with an integration ( |
|
@emontnemery I'd have some additional questions regarding color_mode:
|
|
@farmio I try to answer the questions: Q2: when turned on with brightness slider, what is the expected behavior? White? All channels for rgbw, or just w? Q3: Why can there only brightness information in kwargs when COLOR_MODE_BRIGHTNESS must not be set? With this in mind, is the PR ready for review? |
I guess this is a typo and you meant "not guaranteed"? If the controller supports saving its last brightness/color it will not be overwritten. If this is ok, this PR would be ready for review. |
Yes, fixed above
Yes, that makes sense. |
|
Thanks, @farmio 👍 |
|
Sorry, I missed one detail, why was this needed: c74f12a, that should be OK in Python 3.8 with |
|
This is what I thought too. But apparently it doesn't hold for generic builtins in File "/homeassistant/components/knx/light.py", line 408, in async_turn_on
await set_color(rgbw[:3], rgbw[3], brightness)
File "/homeassistant/components/knx/light.py", line 369, in set_color
tuple[int, int, int],
TypeError: 'type' object is not subscriptableI'd assumed that type argument to |
|
That's odd, I also expected |
Proposed change
Fix assigning individual_color light red address to all channels.
Turn on color light with only brightness in kwargs. E.g., from turning on with brightness slider.
When rgb(w)_color property returns calculate brightness from it.
If color is not known default to white (3 channel for rgb; only white channel for rgbw).
If master brightness address is set it will be used - no color sent.
Previously a individual_color configuration would ignore a turn_on call with only brightness in kwargs.
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: