[ISSUE] A homeowner's user named with a slot number is treated as Lock Code Manager's

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

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #1741 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 parse_tag, which reads a bare-number user name as Lock Code Manager's slot tag, then read the change from #1722 that limits this for the Z-Wave JS release. The same guard is still missing on the Z-Wave JS set path, where slot 3 can adopt a homeowner's user named 3, and in the Matter release, which also falls back to a bare number when the firmware rejects the name's characters. Done means a bare-number user is adopted or deleted only when LCM would have written that exact name on that lock, with tests for both cases.

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

Descrizione

bug
What happened?

Found while reviewing #1722.

Background: parse_tag reads a user named just a number, e.g. 3, as Lock Code Manager's tag for slot 3. LCM really does write that bare form when the lock's name limit can't fit lcm:<slot>:. A homeowner can also name their own user 3 in the vendor app, and LCM can't tell the two apart.

#1722 fixed this for Z-Wave JS release: a bare-number name only counts as LCM's when lcm:<slot>: doesn't fit. Two other places still have the gap:

  • Z-Wave JS set path: writing slot 3 can adopt a homeowner's user named 3. LCM renames it to lcm:3:… and writes its PIN onto it. A later release then deletes that user, along with any other codes the homeowner put on it.
  • Matter release: the same digit gap. The length check from #1722 isn't enough here, because Matter also falls back to a bare N when the lock's firmware rejects the name's characters, not only when the name is too long.

Expected: LCM only treats a bare-number user as its own when it would have written that name itself on that lock. It never adopts or deletes a homeowner's user because the user's name happens to be a slot number.

Steps to reproduce the issue
  1. On a Z-Wave User Credential lock whose name limit fits lcm:3:, create user 7 named 3 in the vendor app, with PIN 5555.
  2. Configure LCM slot 3 and turn it on.
  3. LCM adopts user 7, renames it, and replaces PIN 5555.
Home Assistant Version

dev (found in code review)

What version of Lock Code Manager are you running?

feature/clean-room-core

Lock make and model

Z-Wave User Credential CC locks; Matter


🤖 Generated with Claude Code

https://claude.ai/code/session_0147zKneN1dB51wr1z5orrDQ

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.