[ISSUE] Adding a lock in the options flow overwrites codes already on it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the strict xfail test tests/test_open_bugs.py::test_adding_a_lock_keeps_the_codes_already_on_it and the options flow's Locks step, where a lock is added to an existing configuration and its PINs are written. Read PR #983 and PR #1447 to see why the existing-code check was removed. Done means the test passes, either by refusing the lock and naming the occupied slots or by leaving existing codes untouched, and the choice between those two is a maintainer decision.
Written by the indexing model from the issue text.
Description
What happened?
Adding a lock to an existing configuration (options flow → Locks) overwrites user codes that are already on that lock. The new lock is never read before the configuration's PINs are written to it, so a code someone set at the keypad in one of the configuration's slots is replaced.
Expected: either the flow refuses the lock (naming the slots in the way), or the codes already on it are left alone.
This is a regression. PR #983 detected existing codes when an options update added locks. PR #1447 ("the editor names users, and never a slot number") removed that check, reasoning that "no route can land on one a lock already holds". Adding a lock to an existing configuration is exactly such a route: the configuration's slot numbers are fixed, and the new lock may already hold codes in them.
Steps to reproduce the issue
- Set up a configuration on lock 1 with users in slots 1 and 2.
- On lock 2, have codes already set in slots 1 and 2 (e.g. at the keypad).
- Options flow → add lock 2 to the configuration.
- Lock 2's codes in slots 1 and 2 are replaced by the configuration's PINs.
Tracked by the strict xfail tests/test_open_bugs.py::test_adding_a_lock_keeps_the_codes_already_on_it (on main).
Home Assistant Version
dev (test harness)
What version of Lock Code Manager are you running?
main
Lock make and model
Any (reproduced with the mock lock)
🤖 Generated with Claude Code
- Dominant language
- Python
- Stars
- 108
- Forks
- 18
- Avg merge
- 1h 50m
- Merged PRs (30d)
- 103
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raman325/lock_code_manager
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 22/100
raman325/lock_code_manager#1697 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 22/100
raman325/lock_code_manager#1695 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 24/100
raman325/lock_code_manager#1691 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
raman325/lock_code_manager#1581 · 3 comments ·
Maintainers usually reply within 1 day
-
A bulk-add config flow can wait hours on a slow lock with nothing on screenPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 5/5 Over a week Newbie friendliness 15/100
raman325/lock_code_manager#1536 · 2 comments ·
Maintainers usually reply within 1 day
All issues in raman325/lock_code_manager
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jbacalso24/mimry#291 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 Under an hour Newbie friendliness 82/100
eli-alvarado/us-watchlist-alerts#14 ·
Maintainers usually reply within 1 day
-
from-review-extraction python severity:nit
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
LearningCircuit/local-deep-research#7462 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cathrynlavery/diagram-design#441 ·
Maintainers usually reply within 2 days
-
[Cleanup] Include the public header in work_split.cppPossibly taken @blozano-tt claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tenstorrent/tt-metal#60850 ·
Maintainers usually reply within 1 day