-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
options.supportsHS should be aligned with meta.supportsHueAndSaturation #5811
Conversation
Tested if a random Hue bulb I had in my test box and an Osram one both still worked (Kind of annoying that the frontend uses So tested with:
I also read colorMode afterwards to see if it changed between 0 and 1, it did. There is also some potential follow up work, not sure it's worth it or not. reading enhancedColorMode will show if we're in hs or ehs mode... but that's a lot of extra fiddling to lib/color and to not break home assistant we can't just expand the color_mode payload, so we need to introduce a enhanced_color_mode payload... that might confuse people. |
supportHS is not a
|
I'm dumb, I mixed up option and meta... let me revisit this in the afternoon, I do still think It's rather confusing and we should somehow better align these. As at least some of these changes still make sense .e.g |
OK going to run some errands now, so have some time to think about this some more: Before this PR in the current form:
Rework plan for this PR:
Indicating via options that there is no Hue/Saturation support would then do the same expose changes as before and in addition tell the converters/light.readColorAttributes() that there is no Hue/Saturation support, fixing the inconsistent views in exposes vs converter logic. |
Found another issue with some a tradfri bulb from my test set (this is on current master, not this PR)
The color does not change, as expected as this build has meta.supportsHueAdnSaturation set to false.
We currently only handle these for the get converter as to not hit the UNSUPPORTED_ATTRIBUTE, we should also take care of this when calling set, we can fall back to converting hs to zy. I'll also take this with me into the next pass of this PR. |
OK hit another small roadblock, aside for philips.extend.light_* none of the regular extends set meta at all, there are two options forward:
The first one is the easiest, although I think the 2nd one is the cleanest, I am not sure how the extend + regular meta will interact. Edit: zigbee-herdsman-converters/src/index.js Lines 71 to 74 in 4649dcc
Looks to be safe to just set them in the extend, the non extend one will be merged into it and override any value present in both. Option 2 it is |
b9d99a3
to
bb2e37a
Compare
@Koenkk this is refactor of the previous PR
There is one open question though, meta.supportsHueAndSaturation defaults to true but we set the default for options.supportsHueAndSaturation to false. I think those should be aligned too. So which one is the correct one?
Some tests done on a tradfri that only does XY and a hue one that does XY + (e)HS: LCT012
TRADFRI bulb E27 CWS opal 600lm
The tradfri now falls back to setting the color via XY and warning instead of just sending a command to the bulb which it ignores. |
This brings it inline with the naming for meta, are used to indicate support for Hue/Saturation for a device. The meta is used by the converters and the option by the exposes data.
This brings the naming more inline with the nameing of the other meta's
…h light.readColorAttributes According to the readme `supportsHueAndSaturation` has a default of false, however in `light.readColorAttributes()` we used a default of true. This change corrects it to the default mentioned in readme.md
Bulbs like **TRADFRI bulb E27 CWS opal 600lm** do not support HS, we already skip reading those attributes, however the toZigbee converter does still try to call the moveHue and friends commands which do not work when specifying a `{"color": {"hue": 128, "saturation": 100}` payload. Now we throw an error making it clean this is not supported.
All looks good! I will merge it after the next release (probably friday) |
Bedankt! |
While looking into Koenkk/zigbee2mqtt#17816 I spotted some confusing naming wrt options.supportsHS vs meta.supportsHueAndSaturation.
Both try to do very similar things:
This PR tries to adres this by:
Open Questions: