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
+10 -5
View File
@@ -10,7 +10,8 @@ the headset to Home Assistant in both directions:
- **Dashboard:** a SteamVR dashboard tab to view and control Home Assistant from inside VR.
> **Status:** early development. The overlay platform works on the Frame. The Home Assistant
> parts are being built: so far the settings file. See [docs/REQUIREMENTS.md](docs/REQUIREMENTS.md),
> parts are being built: so far the settings file and the MQTT connection (the device appears
> in Home Assistant with a test sensor, "Uptime"; the tab shows the connection status). See [docs/REQUIREMENTS.md](docs/REQUIREMENTS.md),
> [docs/DESIGN.md](docs/DESIGN.md) and [docs/PROGRESS.md](docs/PROGRESS.md).
### Platform
@@ -46,12 +47,14 @@ cmake --preset native-debug && cmake --build --preset native-debug
ctest --preset native-debug
build/native-debug/bin/frame-assistant --desktop # UI in windows, no SteamVR
build/native-debug/bin/frame-assistant --desktop-novr # same; never uses SteamVR
build/native-debug/bin/frame-assistant --snapshot out.png # one frame through the VR path
build/native-debug/bin/frame-assistant # as dashboard tab (SteamVR running)
build/native-debug/bin/frame-assistant --install-manifest # register + auto-start with SteamVR
```
Overlay and desktop mode need a settings file (below); `--snapshot` and `--benchmark` don't.
Overlay and both desktop modes need a settings file (below) and connect to the MQTT broker;
`--snapshot` and `--benchmark` don't.
On the Steam Frame:
@@ -122,7 +125,8 @@ How the pieces fit together: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
| Option | Meaning |
|--------|---------|
| *(none)* | Run as SteamVR dashboard overlay (SteamVR must be running) |
| `--desktop` | Show the UI in desktop windows, one per surface; no SteamVR |
| `--desktop` | Show the UI in desktop windows, one per surface; no SteamVR (from iteration 3: uses SteamVR if it runs) |
| `--desktop-novr` | Like `--desktop`, but never connects to SteamVR (e.g. on a PC, with its own `--config`) |
| `--config <path>` | Settings file (default `~/.config/frameassistant/config.json`) |
| `--snapshot <png>` | Render one frame per surface off-screen and save it (`<name>-<id>.png` with several surfaces) |
| `--benchmark <frames>` | Render frames back to back with a full GPU wait each and print frame times |
@@ -137,7 +141,8 @@ How the pieces fit together: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
## Testing
```sh
ctest --preset native-debug # unit + render tests (GPU tests skip without a GPU context)
ctest --preset native-debug # unit, MQTT and render tests (GPU tests skip without a GPU
# context, MQTT tests without the mosquitto broker)
scripts/container-test.sh # all tests in Debian incl. Vulkan with validation layers
VK_DRIVER=lvp scripts/container-test.sh # same on the lavapipe software driver
```
@@ -147,7 +152,7 @@ VK_DRIVER=lvp scripts/container-test.sh # same on the lavapipe software driver
| Path | Content |
|------|---------|
| `src/main.cpp`, `src/Dashboard.*`, `src/qml/` | **The app** |
| `src/config/` | Settings file (`frameassistant_lib`) |
| `src/config/`, `src/mqtt/`, `src/ha/` | Settings file, MQTT client, HA device and entities (`frameassistant_lib`) |
| `src/app/` | `DashboardApplication` (app base class), `Surface` (one view) |
| `src/render/` | Off-screen Qt Quick renderer; Vulkan and OpenGL backends |
| `src/vr/` | SteamVR connection, overlays (dashboard tab) |