feat(led-tool): browser settings editor with Web Serial

Add static editor, host_ports filtering, Flask /editor and REST APIs
for ports and led-cli read/write; document standalone and embedded use.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-18 14:54:15 +12:00
parent 1edcb8b1f7
commit f74e21f206
6 changed files with 1141 additions and 2 deletions

View File

@@ -36,6 +36,25 @@ Connection is always via **`-p` / `--port`** (default `/dev/ttyACM0`). There is
Run **`python cli.py -h`** for the full epilog and argument list.
## Web UI (`static/` + `web.py`)
Edit **`settings.json`** in the browser:
- **Web Serial** — USB on the machine running the browser (Chrome/Edge). Use **Connect USB**, then **Download** / **Upload**.
- **Host serial** — USB on the Pi/PC running **`led-cli`** (port list + **`led-cli`** merge/upload).
**Standalone (Flask):**
```bash
cd led-tool
python web.py
# open http://<host>:5000/editor
```
**Embedded in led-controller:** open **LED Tool** in the main UI, or visit **`/led-tool/editor`**.
Legacy Flask form UI remains at **`/`** on port 5000; prefer **`/editor`** for Web Serial support.
## License
See **LICENSE** in this directory.