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

[Feature Request] Per-lock slot numbers for users

Aperta
#1,739 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by tracing slot storage and lookup in model/config.py, model/queries.py, config_flow.py, and init.py, then review the existing migration path and the per-lock worker in sync/worker.py. The issue describes changes across configuration, allocation, lookups, events, cards, diagnostics, and automations, so map those surfaces before estimating the work. Done means users hold a slot per lock, existing configurations migrate without lock-side changes, and the listed user-visible surfaces work with per-lock slots.

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

Descrizione

enhancement
Problem Description

Each user holds one slot number (CONF_SLOT) that is used on every lock in the configuration. Lock Code Manager picks it when the user is added, as a number free on all of the configuration's locks at that moment. That shared number causes the hardest limits left in the "you don't pick slots" design:

  • Allocation needs a number free on every lock. The more locks in a configuration, and the more unmanaged codes they hold, the fewer numbers qualify.
  • Adding a lock is refused (existing_codes) when the new lock already holds codes at numbers the configuration's users hold. The numbers were issued before the lock joined, and renumbering a user would mean rewriting their code on every other lock.
  • A smaller lock constrains the configuration (slot_out_of_range): a user on slot 30 can't be added to a 20-slot lock even if it has free slots.
Feature Description

Give each user a slot number per lock instead of one shared number.

The 7.0 engine is already per lock, so most of the stack needs no change:

  • one LockWorker per lock with its own slot table (sync/worker.py);
  • the lock_code_manager.core store is keyed per lock;
  • queries already take a lock: slots_configured_on(hass, lock), configured_owner(hass, lock, slot);
  • tags (lcm:<slot>:), events and attribution are read per lock;
  • Matter already decouples the slot from the device credential index, and Akuvox/Schlage have no indices at all (the slot only lives in the tag).

What would change:

  • Config: a user holds {lock: slot} instead of CONF_SLOT, with a migration that copies today's number onto every lock (no lock-side change on upgrade).
  • Allocation: pick a free slot per lock; adding a lock picks free slots on that lock instead of refusing with existing_codes; slot_out_of_range goes away.
  • Lookups: "user on lock" replaces "slot" as the key in model/config.py, model/queries.py, config_flow.py, __init__.py (CONF_SLOT is read in ~17 places).
  • User-visible surfaces built on "slot N": event entity code_slot attribute and slot-based automations, the lock codes card's per-slot rows, the user card, the duplicate check across entries (slots_already_configured), diagnostics, and the slot section strategy.
Anything else?
  • Risk is mostly in the migration and in automations that assume the same code_slot on every lock; this needs its own upgrade note.
  • A user's slot number could still default to the same number on every lock when one is free everywhere, so most configurations would look unchanged.
  • Out of scope for 7.0.0; a candidate for 7.x.
Lingua principale
Python
Stelle
112
Fork
20
Merge medio
2h 53m
PR unite (30g)
140

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.