-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Fix Matter Door Lock Operating Mode select entity #158468
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
base: dev
Are you sure you want to change the base?
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
|
… update tests for supported modes
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.
Pull request overview
This PR fixes a bug where the Matter Door Lock Operating Mode selector was showing all 5 operating modes regardless of device capabilities. The solution implements bitmap-based filtering using the Matter specification's SupportedOperatingModes attribute, where bit=0 indicates a supported mode and bit=1 indicates unsupported.
Key changes:
- Created specialized
MatterDoorLockOperatingModeSelectEntityclass that reads and interprets theSupportedOperatingModesbitmap - Changed discovery schema to use
MatterMapSelectEntityDescriptionwith bitmap attribute support - Updated tests to verify bitmap-based filtering and only test with supported operating modes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
homeassistant/components/matter/select.py |
Implements new MatterDoorLockOperatingModeSelectEntity class with bitmap interpretation logic and updates discovery schema to require SupportedOperatingModes attribute |
tests/components/matter/test_select.py |
Updates test to verify bitmap-based filtering works correctly with fixture that has bits 0, 2, and 3 cleared (Normal, Privacy, NoRemoteLockUnlock supported) |
tests/components/matter/snapshots/test_select.ambr |
Updates snapshots to reflect filtered options based on each fixture's bitmap values instead of showing all 5 modes |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Proposed change
Problem: The Door Lock Operating Mode selector was including all 5 operating modes unconditionally, but the Matter specification uses a bitmap attribute (
SupportedOperatingModes) to indicate which modes a device actually supports.Solution: Created a specialized
MatterDoorLockOperatingModeSelectEntityclass that:SupportedOperatingModesbitmap from the deviceDOOR_LOCK_OPERATING_MODE_MAPfor all possible translationsKey Features:
SupportedOperatingModes Attribute
Type of change
Additional information
Checklist
ruff format 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.To help with the load of incoming pull requests: