skip_configuration() also skips attribute initialization

Aperta
#1,015 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Read async_configure() and async_initialize() in zha/zigbee/device.py to see how the shared skip_configuration flag controls reporting setup and initial attribute reads. Then trace QuirkBuilder’s skip_configuration() implementation and documentation. Decide whether to split the behavior as suggested or clarify the existing behavior; done means the API and docs consistently describe when startup attribute reads occur.

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

Descrizione

I noticed .skip_configuration() does more than its documentation suggests.

In the zha-device-handlers repository, copilot-instructions.md describes it as:

.skip_configuration() - Skip attribute reporting configuration

The method's docstring also only mentions skipping reporting configuration.

However, in ZHA's device.py, the same skip_configuration flag is checked in both async_configure() and async_initialize().

As a result, enabling .skip_configuration() also skips the initial attribute reads for entities defined in QuirkBuilder.

This also affects the Refresh mains-powered devices state on startup option. Even when enabled, attribute initialization is skipped for these devices.

Suggestion

Would it make sense to separate these two operations?

For example:

  • .skip_configuration() — skip binding and reporting configuration.
  • .skip_initialization() — skip initial attribute reads.

This would allow devices that don't support standard reporting configuration to still have their attributes read during initialization and startup refresh.

If the current behavior is intentional, perhaps the QuirkBuilder documentation and method docstring should at least be updated to clarify that .skip_configuration() also disables attribute initialization.

Lingua principale
Python
Stelle
96
Fork
84
Merge medio
3g 1h
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 zigpy/zha

Tutte le issue di zigpy/zha

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.