Use hue/sat as internal light color interface#11288
Conversation
f594904 to
b91121f
Compare
|
That's what I was thinking, but Another alternative would be to always transform color requests to XY in |
|
The best would be, that home-assistant support only one color schema and all other need be converted. That what we have currently is bad by design. Anyway, I think we should convert it in any case like the others does. |
|
👍 I think in an ideal world we'd only support XY color, since RGB has the confusing overlap with brightness. Unfortunately I don't think we can get away from RGB in the API since it's so ubiquitously understood, but we can at least limit the complexity of what is sent to platforms. |
| if ATTR_RGB_COLOR in params and \ | ||
| entity.supported_features & SUPPORT_XY_COLOR and not \ | ||
| entity.supported_features & SUPPORT_RGB_COLOR: | ||
| rgb = params.pop(ATTR_RGB_COLOR) |
There was a problem hiding this comment.
You should make a copy before mutating
|
I will just remind that you advised against doing this in my old PR #6727 (comment) I am not saying that this should exclude you from doing the change now, it is certainly acceptable to change your mind. However, I wonder whether your new use-case is perhaps blinding you from seeing the larger picture that you identified in my PR. |
|
😆 Thanks for bringing that up! Those notes are some good context. I think I've come to a better solution here thanks to this feedback, that hopefully keeps complexity limited. |
a401293 to
7251cf2
Compare
OttoWinter
left a comment
There was a problem hiding this comment.
Light groups and all the MQTT platforms look good 👍
See home-assistant/core#11288; it doesn't do aynthing anymore
* Make device_class optional * Improve WiFi debug logging The arduino-esp32 project broke wifi ... again * Remove erroneus assert * Basic ESP8266 support Mostly just disables lots of functionality for the ESP8266 that should eventually be re-implemented for this platform. * Fix merge * Fixes * A bunch of changes Couldn't be bothered to split them up in different PRs, sorry :/ * Remove Light XY support See home-assistant/core#11288; it doesn't do aynthing anymore * Masive Refactor * Another huge refactor
|
Is this the reason MQTT RGB broke up? |
|
I think this might be related to my issue with tradfri bulbs paired with hue hub? #13614 |
|
Since change 89c7c80 (on Mar 18) to tplink.py, my TP-Link lights stopped supporting color. Color used to work in HA (on the UI or by setting color using commands) before that change, and the lights support color when using the Kasa app. I'm new to this, so I don't know what other info I could provide to troubleshoot this. |
|
@Arkadyf No more information is needed but please create a separate GitHub issue. You can add a note that the problem probably is due to us no longer casting hsv to integers. |
Description:
This PR converts hass to use hue/sat as the core interface for colors. Platforms will only receive
turn_oncalls with hue/sat, and only need to report their entity colors in hue/sat. The light component will convert incoming service calls in other formats to hue/sat, and will make the entity colors in hue/sat from the platforms available to clients in RGB and XY form as well.The use-case I have in mind is that I've been digging into the ZHA platform, and it natively prefers to work with XY colors instead of RGB. I think it's best if we just let the light component do the translation, so that platforms don't need to worry about supporting multiple formats, and can implement their preferred method. Doing the conversion in one place should also help give consistent behavior on how brightness is handled.