Connect the app to MQTT and show the connection status (iteration 2, step 4)

Dashboard creates the MQTT client and the HA device with the dummy
"Uptime" sensor (D41) in overlay and both desktop modes, connects in
started() and disconnects gracefully on aboutToQuit. The new platform
mode --desktop-novr behaves like --desktop for now (D22). The main tab
shows device, broker, connection state and last error (UI-1) through
the ConnectionStatus QML singleton.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 16:18:17 +02:00
co-authored by Claude Opus 5.5
parent 466743eff9
commit 943e90c1b1
15 changed files with 335 additions and 32 deletions
+18 -3
View File
@@ -23,9 +23,9 @@ CLAUDE.md ("Working rules").
The error itself is covered off the device by `tst_config`. Checks 3 and 4 run in the next
session on the Frame (iteration 2 testing needs it too).
- **Implementation** follows the order in DESIGN.md (steps 1–7). Steps 1 (libmosquitto in
CMake and the containers), 2 (`MqttClient`, `MosquittoClient`, `tst_mqtt`) and 3
(`HaEntity`, `HaSensor`, `HaDevice`, unit tests) done; next: step 4 (app wiring,
`--desktop-novr`, UI-1).
CMake and the containers), 2 (`MqttClient`, `MosquittoClient`, `tst_mqtt`) 3
(`HaEntity`, `HaSensor`, `HaDevice`, unit tests) and 4 (app wiring, `--desktop-novr`,
UI-1) done; next: step 5 (TLS).
## Next steps
@@ -149,6 +149,21 @@ Known limitation: the bundled-Qt package does not support WebEngine in this iter
`HaSensor`, `HaDevice` (discovery payload, publish all after connect and after HA's birth
message with random delay, last will, `removeFromHa()`), `FakeMqttClient` for tests.
`tst_haentity` 11/11, `tst_hadevice` 14/14 on the host.
- Step 4: platform mode `DesktopNoVr` (`--desktop-novr`, behaves like `--desktop` for now;
`tst_surfaces` `surfaces_desktop_novr`); `Dashboard` creates client and device in
`loading()`, connects in `started()`, feeds the dummy sensor every 10 s and disconnects
gracefully on `aboutToQuit`; `ConnectionStatus` QML singleton and the status card in
`Main.qml` (UI-1). Checked:
- end to end against a local mosquitto (`--desktop-novr`, watched with `mosquitto_sub`):
discovery, `online`, state and availability in the designed order; broker restart →
"connection lost", "connection refused", reconnect and full republish; `kill -9` → will
`offline`. (mosquitto also sends the will when it shuts down itself.)
- screenshots under Xvfb: unconfigured (snapshot), connected, not connected with last
error.
- `container-test.sh` 12/12, no Vulkan validation messages; cross build links
`libmosquitto.so.1`, at most `GLIBC_2.34`, private Qt symbols only `QVulkan*`.
- Not checked yet: the graceful exit through `aboutToQuit` in the app (only in
`tst_mqtt`); it needs a real window close or "Quit app" in SteamVR (manual test).
### 2026-10-05: requirements approved