add ui, new config opts

This commit is contained in:
2026-07-16 16:32:44 -04:00
parent 8effff311b
commit df01e060e4
33 changed files with 1104 additions and 37 deletions
+21
View File
@@ -10,6 +10,27 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Added
* **Admin UI** at `/` (`econetui`): a server-rendered dashboard of devices and
their status (connectivity, running state, setpoint, hot-water, alerts) with a
per-device mode dropdown that writes via the in-process gRPC server. HTMX for
interactivity (30s auto-refresh, card-level swaps), Pico.css + embedded SVG
icons per device type, a hot-water **fill-level meter**, a 🐛 debug button
that shows the raw device JSON, and a persisted **dark-mode toggle** — all
served from a single binary via `embed.FS`, responsive down to mobile. Mode
changes show a best-effort, TTL-bounded "Updating…" pending badge that
reconciles against the reported state (or falls back to a fresh fetch if it
never lands). Auth is intentionally left to the edge (e.g. oauth2-proxy);
`/health` and `/metrics` stay unauthenticated.
* `enableWebUI` config (env `ECONET_ENABLE_WEB_UI`, default **true**) to toggle
the admin UI, and `disableWaterUsage` (env `ECONET_DISABLE_WATER_USAGE`,
default false) to skip the per-device water-usage REST call on units that
don't report it.
* `MODE_ELECTRIC_GAS` added to the `Mode` enum — real devices report a combined
"Electric/Gas" mode that was previously decoded as unknown and dropped from
the settable-mode list.
* `supported_modes` on the `Device` proto message (the settable modes for that
unit), populated from the device's reported mode list and surfaced over gRPC,
REST, and MCP.
* **Mode control (first mutating RPC).** New `SetMode` RPC on `EconetService`,
exposed over gRPC, the REST gateway (`POST /v1alpha1/devices/{serial}/mode`),
and as an MCP tool. Writes go out over ClearBlade's REST publish endpoint