Skip to content

Require panel lifecycle to be independent of device availability #48

Description

@NikaSir

Architecture rule

Specialized panel existence must be independent of physical device/telemetry availability.

A configured panel route/sidebar entry is application infrastructure. Device reachability may change the content to Нет связи, Недоступно, unknown or unavailable, but must never make the panel itself disappear.

Required lifecycle contract

For integration-owned panels:

  1. create coordinator/client;
  2. publish runtime state required by panel bootstrap;
  3. register stable panel route/sidebar entry;
  4. perform first device/RCI/Tuya/etc. refresh as a non-fatal operation;
  5. set up entities;
  6. keep retrying telemetry on the normal coordinator cadence.

Do not gate panel registration behind async_config_entry_first_refresh() or any successful device read.

For generated subpanels:

  • manifest/configuration controls whether the panel exists;
  • current entity availability controls only rendered state;
  • missing/unavailable entities must fail closed inside the panel, not remove the route.

Evidence

The same anti-pattern has now been found in two separate integrations:

  • ha-keenetic-hero-4g: panel registration followed async_config_entry_first_refresh(), causing /dashboard-keenetic to disappear when startup RCI polling failed;
  • ha-s8-omni: _async_register_panel() likewise runs only after async_config_entry_first_refresh(), matching the previously observed disappearing vacuum panel behavior.

Acceptance

  • Add this rule to the canonical specialized/generated panel standard.
  • Add a CI/static contract where practical.
  • Audit integration-owned panels (Keenetic, S8 OMNI, UPS, irrigation and future panels) for first-refresh-gated registration.
  • Keep CGUI chrome/navigation independent from current device availability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions