Repository navigation
fix: adding a user whose PIN is taken or too long names them in a message Home Assistant accepts - #1810
Merged
Conversation
…sage Home Assistant accepts
Hassfest now rejects translation strings with a placeholder inside single
quotes, so the two add_user refusals that wrote "'{name}': ..." failed
validation on every pull request. They now use the same wording as the
editor's errors for the same rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: a38362a6ba68
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the error-message wording updates addressing Hassfest’s placeholder restrictions.
No open issues 🎉
What changed in this PR
This PR updates Lock Code Manager’s add_user error messages to address Hassfest’s rejection of single-quoted placeholders, which was blocking checks on dependency-update PRs.
Changes:
- Rewords duplicate-PIN and overlong-PIN errors while preserving the user’s name.
- Keeps source strings and English translations aligned.
- Updates service-test expectations to match the revised messages.
| File | Description |
|---|---|
tests/test_services.py |
Updates expected duplicate-PIN and overlong-PIN error messages. |
custom_components/lock_code_manager/translations/en.json |
Applies the revised wording to English translations. |
custom_components/lock_code_manager/strings.json |
Removes single quotes around name placeholders in both source messages. |
Review effort: Balanced
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Hassfest now rejects a translation string with a placeholder inside single quotes. Two
add_userrefusals wrote"'{name}': ...", so Hassfest failed on every pull request, and the Auto Merge check failed with it. That's why every open Dependabot PR is red.The two messages now use the same wording as the editor's errors for the same rules (
pin_not_unique_in_block,pin_too_long_in_block):user_pin_not_unique'{name}': Another user already has this PIN.{name} has a PIN another user already has.user_pin_too_long'{name}': PIN may be at most 255 characters.{name} has a PIN longer than 255 characters.The change covers
strings.json,translations/en.jsonand the tests that match the rendered messages.Type of change
Additional information
🤖 Generated with Claude Code