Add support for Z-Wave credential management#168360
Conversation
|
Hey there @home-assistant/z-wave, 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.
Pull request overview
Introduces first-pass Z-Wave JS “Access Control” (credential/user) management via new lock entity services, helper logic, and accompanying UI strings/icons plus tests.
Changes:
- Add
access_control_helpers.pyimplementing user/credential CRUD, capability queries, and auto-slot selection. - Register new credential-management services and wire them through the Z-Wave lock entity.
- Add service UI metadata (strings/icons/services.yaml) and initial test coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/zwave_js/access_control_helpers.py |
New helper module implementing access-control business logic and structured service responses. |
homeassistant/components/zwave_js/lock.py |
Adds lock entity methods for new access-control services with translated error wrapping. |
homeassistant/components/zwave_js/services.py |
Registers new platform entity services and validates service schemas. |
homeassistant/components/zwave_js/services.yaml |
Declares new services and selectors for the service UI. |
homeassistant/components/zwave_js/strings.json |
Adds translated error messages and service field descriptions for credential management. |
homeassistant/components/zwave_js/icons.json |
Adds service icons for the new credential/user services. |
homeassistant/components/zwave_js/const.py |
Adds service/attribute constants and credential/user type string constants. |
tests/components/zwave_js/test_credential_services.py |
Adds tests for new credential management services and auto-find behavior. |
7a16119 to
69b377e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
| async_register_platform_entity_service( | ||
| hass, | ||
| const.DOMAIN, | ||
| "set_user", | ||
| entity_domain=LOCK_DOMAIN, |
There was a problem hiding this comment.
No, Martin said explicitly to not do that.
@abmantis something for the agent instructions maybe?
There was a problem hiding this comment.
I don't think we need to add this to instructions, unless we see it happen more often (I haven't seen it before). It probably pointed it out because the integration does that for the other service and the new ones are inconsistent.
| "١٢٣٤", # Arabic-Indic digits — str.isdigit() returns True | ||
| "1234", # Fullwidth digits — str.isdigit() returns True |
There was a problem hiding this comment.
Ok to add, but not required.
|
The test failure looks unrelated |
|
One question left: |
| max: 65535 | ||
| step: 1 | ||
| mode: box | ||
| user_name: |
There was a problem hiding this comment.
Could be good to add, but not required.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Proposed change
This PR adds support for Z-Wave credential management. This first iteration is aligned with the Matter credential mangement added in #161936, home-assistant/frontend#28672 and followup PRs.
The main difference is that this PR also adds support for having multiple credentials of the same type per user, and distinguishes between PINs (0-9) and passwords (alphanumeric).
Like Matter, we expose the credential management through the
lockentity. Even though the functionality is technically not limited to locks, in practice there haven't been any non-lock devices with user management features.Depends on home-assistant-libs/zwave-js-server-python#1418
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: