-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Fix matter light color capabilities bit map #88693
Conversation
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all: thanks!
See my review comments, try to prevent lookups for values that are static. Just do that once in the entity init or how it is now: check if the "supported_color_modes" attribute is still None and set some local variables which are cheap to access.
As for the custom Enum I'd suggest to remove that and copy the BitFlags for now from the SDK code so we can just use that as soon as we move to a newer sdk version.
I will test with the white ambiance lights but I'm pretty sure this was the missing piece of the puzzle yesterday!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
class ColorCapabilities(IntFlag): | ||
"""Color control capabilities bitmap.""" | ||
|
||
kHueSaturationSupported = 0x1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what k
means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, the only reason it's there is cuz that's how the code generated on the matter repo has it and we can just remove this entire enum once the library is updated https://github.com/project-chip/connectedhomeip/blob/61cf6f2368a4fc20e96d0ba87bda9a78a6028717/src/controller/python/chip/clusters/Objects.py#L20332-L20345
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't know either why the k is in there but let's stick to the SDK definitions so all good now, thanks @ArturoGuerra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, works perfectly fine now with the white ambiance lights
Perfect only thing that is missing now is getting the enhanced hue stuff working but I don't think there are any lights that even support it atm so testing might be a bit challenging 😀 |
* Adds matter light color capabilities bit map * Fixed matter light hue and saturation test
Breaking change
Proposed change
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
.To help with the load of incoming pull requests: