Repository navigation
fix(gateway): isolate optional Hub display connection health - #5500
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
Core health behavior is correct; the remaining entity-grouping inconsistency is non-blocking.
1 open finding
What changed in this PR
Separates optional Hub display connectivity from Gateway component health while preserving control-mode transport checks.
Changes:
- Publishes dedicated display connectivity health.
- Keeps Cloud operation and
/api/pinghealthy during display outages. - Adds lifecycle and regression coverage.
| File | Description |
|---|---|
apps/predbat/gateway.py |
Separates display transport and component health. |
apps/predbat/tests/test_gateway_display.py |
Tests outage isolation and control health. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nal-health # Conflicts: # apps/predbat/gateway.py # apps/predbat/tests/test_gateway_display.py
|
Automated cleanup failed to complete for this PR. Reason: The run exited cleanly but left 6 file(s) with uncommitted changes, so its fixes were never pushed. They are stashed in the bot's clone before the next flow runs. Failed at: |

An offline optional Hub display currently makes a working Cloud-controlled instance fail component health, report an optimisation error and return HTTP 500 from
/api/ping. Keep display transport availability separate from the display component process health. Successful display housekeeping advances its timestamp and reports a separate connectivity sensor; active Hub control retains its existing transport-health checks.Stacked on #5496. No production rollout or canary enablement.
Validation: 14 display regressions pass, including the real Components, PredBat final-run status and web ping paths with broker disconnection, offline Hub and stale online telemetry; a stopped component still fails the probe and control transport failures remain unhealthy. Native Gateway and component groups pass, as does the local TLS MQTT cross-repository integration covering GivEnergy/FoxESS config, token refresh, role transitions and command isolation. Black, Ruff and diff checks pass. Independent review found no new blocker.
The tests prove stopped-thread detection, not every possible live-thread stall. Provider APIs and physical Hub standby remain outside the local harness.