This commit is contained in:
Mateusz Gruszczyński
2026-08-23 22:05:24 +02:00
parent 1d3dcba1a9
commit 9c9b7b272b
25 changed files with 902 additions and 252 deletions
+38 -51
View File
@@ -1,70 +1,57 @@
# GREE Controller v0.3.3 - build and validation report
# GREE Controller v0.3.5 - build and validation report
## Scope of this release
## Scope
Version 0.3.3 prepares the project for repeatable Debian/Ubuntu LXC testing and centralizes SQLite statements.
Version 0.3.5 focuses on mixed-generation GREE networks and mobile day-to-day control.
Changes include:
### GREE protocol fixes
- all operator-facing shell/Python utilities are under `scripts/`,
- root-level `dev.sh` and `install-lxc.sh` were removed,
- `scripts/dev.sh` contains the previous development workflow,
- `scripts/install.sh` performs first systemd/LXC installation,
- `scripts/update.sh` performs tested in-place updates with stopped SQLite backup, health check and automatic rollback,
- `scripts/service.sh` wraps common service operations,
- `scripts/install-lxc.sh` is a compatibility alias located inside `scripts/`,
- `scripts/common.sh` provides shared deployment helpers,
- `docs/LXC.md` documents the installed filesystem layout and update process,
- every application SQLite statement and schema definition is now in `src/queries.rs`,
- `src/db.rs` contains no embedded SQL statements,
- Cargo package version updated to 0.3.3.
- corrected the standard AES-128-ECB generic key,
- corrected the standard AES-128-GCM generic key,
- GCM now uses the fixed 12-byte nonce and `qualcomm-test` AAD used by EWPE/GREE Wi-Fi modules,
- discovery detects GCM by the response `tag` and decrypts it with the GCM generic key,
- discovery supports Auto/V1/V2 filtering and 1-10 repeated scan passes,
- protocol packets use `cid="app"`, `i=1` for bind and `i=0` for status/commands,
- Celsius commands follow the standard command payload and use whole-degree `SetTem`; `TemRec` is not misused as a Celsius half-degree flag,
- bind refreshes the device with a direct scan and falls back between ECB/GCM,
- discovery attempts an immediate bind and persists the successful protocol/key,
- status falls back to a smaller core property list if a model rejects the extended list,
- command failure triggers one fresh-bind retry before returning an error,
- polling also performs a one-time rebind/retry before increasing the communication failure counter.
## LXC persistent paths
### Availability behavior
```text
/opt/gree-controller/gree-controller
/etc/gree-controller.env
/var/lib/gree-controller/gree-controller.db
/var/backups/gree-controller/<timestamp>/
/etc/systemd/system/gree-controller.service
```
- one UDP timeout no longer immediately marks a device offline,
- a device is marked offline after 3 consecutive communication failures,
- successful bind/poll/command resets the failure counter.
The updater preserves `/etc/gree-controller.env` and backs up the stopped SQLite database before launching the new binary.
### Web UI
## Validation performed in the packaging environment
- newly discovered units open a friendly-name step, and they can also be renamed later from the Devices view,
- unnamed units receive a model/MAC-based fallback name instead of `Klimatyzator GREE`,
- discovery dialog exposes Auto/V1/V2, scan passes and total scan time,
- zone cards have direct +/- 0.5 C controller setpoint controls; physical GREE setpoints are normalized to whole Celsius degrees,
- zone cards have direct Heat/Cool buttons without opening the edit dialog.
## Validation performed
| Check | Result |
|---|---|
| `bash -n scripts/*.sh` | PASS |
| Python syntax for migration/HA integration | PASS |
| JSON parsing for language packs, HA translations and manifests | PASS |
| JavaScript syntax (`node --check web/app.js`) | PASS |
| No root-level operator `.sh`/`.py` files | PASS |
| SQL keyword scan outside `src/queries.rs` | PASS - no SQL statements found |
| EN/PL localization files preserved | PASS |
| `gree_controller` namespace preserved | PASS |
| JSON parsing for EN/PL language packs | PASS |
| Shell syntax (`bash -n scripts/*.sh`) | PASS |
| Python syntax for scripts and HA integration | PASS |
| SQL remains centralized in `src/queries.rs` | PASS |
| Package naming remains `gree_controller` / `GREE_CONTROLLER_*` | PASS |
`shellcheck` is not installed in the packaging environment, so a shellcheck pass could not be performed.
A full `./scripts/dev.sh --check` was attempted in the packaging environment, but Rust is not preinstalled and DNS access to `sh.rustup.rs` is blocked there. Final Rust type-check, tests and release build are therefore performed by `scripts/update.sh` or `scripts/install.sh` inside the target LXC.
The packaging environment also does not contain a Rust/Cargo toolchain, therefore the final compiler/type-check must be executed inside the target LXC. The provided installer does this by default.
Recommended first-install validation:
```bash
sudo ./scripts/install.sh
./scripts/service.sh status
./scripts/service.sh health
```
Recommended source/development validation:
```bash
./scripts/dev.sh --check
```
Recommended update validation with a newer archive:
Recommended LXC update:
```bash
sudo ./scripts/update.sh
./scripts/service.sh health
journalctl -u gree-controller -n 150 --no-pager
```
For the reported mixed-model network, start discovery with **Auto (V1 + V2)**, 3 passes and 6000 ms. If fewer units appear, run V1-only and V2-only scans separately and inspect the service log.