Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[ISSUE] Adding a lock in the options flow overwrites codes already on it

Open
#1,684 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

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

bug
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
  1. Set up a configuration on lock 1 with users in slots 1 and 2.
  2. On lock 2, have codes already set in slots 1 and 2 (e.g. at the keypad).
  3. Options flow → add lock 2 to the configuration.
  4. 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

Open in Codespaces

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raman325/lock_code_manager

All issues in raman325/lock_code_manager

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.