Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa
#1,684 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #1702 di @raman325 — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
112
Fork
20
Merge medio
2h 57m
PR unite (30g)
158

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di raman325/lock_code_manager

Tutte le issue di raman325/lock_code_manager

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.