This commit is contained in:
Mateusz Gruszczyński
2026-08-23 23:32:26 +02:00
parent b23578a0c8
commit f569b7db14
42 changed files with 597 additions and 4104 deletions
+29 -44
View File
@@ -1,64 +1,49 @@
# GREE Controller v0.4.1 - build and validation report
# GREE Controller v0.4.2 - build and validation report
## Scope
Version 0.4.1 is a Web UI redesign release. Backend HVAC logic, protocol handling, SQLite layout and Home Assistant API behavior are intentionally unchanged from v0.4.0.
Version 0.4.2 expands climate history and removes the Node/Tailwind build pipeline.
## UI redesign
### History changes
The embedded interface was rebuilt around a Supabase-inspired dashboard language while keeping original GREE Controller branding and information architecture:
- Added a dedicated `zone_readings` SQLite table.
- History samples include GREE indoor temperature, optional Home Assistant room temperature, calculated control temperature, effective profile target, device setpoint, Home Assistant outdoor temperature, power, HVAC mode, fan speed, demand, control source and active preset.
- Zone history is sampled no faster than every 15 seconds (or the configured device poll interval when longer) to avoid unnecessary SQLite growth.
- Added `GET /api/history` for one zone or all zones.
- History UI now supports a detailed per-zone view and common multi-zone comparison charts.
- Existing `readings` data and tables remain intact; the new table is created automatically on startup.
- compact neutral surfaces instead of oversized cards,
- thin theme-aware borders and 6-8 px radii,
- restrained green brand accent,
- no decorative shadows or background gradients,
- full desktop sidebar for Dashboard, Devices, Zones, History, Schedules, Automations, Settings and Events,
- existing five-item bottom navigation retained on phones,
- compact inputs, selects, segmented controls and dialog controls,
- custom inline navigation SVG icons with no external icon dependency,
- themed, narrow scrollbars with transparent tracks,
- Light, Dark and System themes driven from the same CSS token set,
- updated PWA theme colors and service-worker cache version.
### Web asset changes
## Offline Tailwind tooling
Added:
- `package.json`,
- `tailwind.config.js`,
- `web/tailwind.input.css`,
- `scripts/build-web.sh`.
Tailwind is development/build tooling only. The production controller serves the committed `web/styles.css`, which is embedded in the Rust binary. The browser never contacts a Tailwind CDN and the installed LXC service does not require Node.js.
If local Tailwind dependencies are installed, `dev.sh`, `install.sh` and `update.sh` rebuild the CSS automatically. Otherwise they use the committed prebuilt CSS.
The packaging environment could not download the npm Tailwind dependency because external npm access timed out. This does not affect the shipped UI because `web/styles.css` is already present and validated. `scripts/build-web.sh --install` can install the optional local build dependency on a development host with npm access.
- `web/styles.css` is now the only CSS source used by the application.
- Removed `package.json`, `tailwind.config.js`, `web/tailwind.input.css` and `scripts/build-web.sh`.
- Removed all Node/npm/Tailwind build hooks from `dev.sh`, `install.sh` and `update.sh`.
- The CSS remains fully local and is embedded in the Rust binary with `include_str!`.
## Validation performed
Passed:
Passed in the packaging environment:
- `web/app.js`: `node --check`,
- `web/index.html`: Python HTML parser,
- `web/styles.css`: `tinycss2` stylesheet parser,
- `lang/*.json`: JSON parsing,
- `scripts/*.sh`: `bash -n`,
- `scripts/generate_ha_migration.py`: Python bytecode compilation,
- `web/tailwind.input.css` semantic CSS section matches the committed `web/styles.css`,
- no `node_modules` directory is included,
- project-owned SQL remains centralized in `src/queries.rs`.
- JavaScript syntax: `node --check web/app.js` and `web/sw.js`.
- JSON syntax for EN/PL language files and the PWA manifest.
- EN/PL translation-key parity (300 keys each).
- Shell syntax for all scripts in `scripts/`.
- Python syntax for the Home Assistant migration generator.
- HTML parsing and CSS brace-balance checks.
- SQLite schema creation plus insert/throttle/read tests for `zone_readings`.
- SQL centralization check: new SQL statements are in `src/queries.rs`.
- No Node/npm/Tailwind build files remain in the release tree.
## Rust build
## Rust compilation
The packaging environment does not provide a working Cargo toolchain, so `cargo test --all-targets` and the release build were not executed here. On the target LXC, `scripts/install.sh` / `scripts/update.sh` run the Rust tests and release build before replacing the installed service.
The packaging environment does not contain Cargo/Rust, so a full Rust compile could not be executed here. The LXC installer/updater still runs `cargo test --all-targets` before replacing the installed binary, unless `--skip-tests` is explicitly used.
## Expected LXC update
## Recommended LXC update
```bash
unzip gree-controller-v0.4.1.zip
unzip gree-controller-v0.4.2.zip
cd gree-controller
sudo ./scripts/update.sh
```
Runtime configuration and SQLite data remain under `/etc/gree-controller.env` and `/var/lib/gree-controller/` and are preserved by the updater.
The updater preserves `/etc/gree-controller.env` and `/var/lib/gree-controller/gree-controller.db` and rolls back automatically if the new service fails its health check.