diff --git a/.gitignore b/.gitignore index 0b5fd7e..98d679f 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,11 @@ logs/ # shipped sound assets out of the CI tag checkout. /data/ /server/data/ +# Defensive: if the server is launched from server/src/ (uncommon path), +# its relative `data/` dir resolves to server/src/data/. Templates now +# live in SQLite, so any *.json that lands here is stale runtime export +# and must not be committed. +/server/src/data/ *.db *.sqlite *.json.bak diff --git a/TODO.md b/TODO.md index a087383..ddd01e9 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,19 @@ # LedGrab TODO +## Server shutdown action + +Let user choose what happens to LED targets on server shutdown. + +- [x] Backend storage: `shutdown_action` in `db.settings` (`"stop_targets"` default | `"nothing"`) +- [x] Backend route: `GET/PUT /api/v1/system/shutdown-action` in `system_settings.py` +- [x] Backend schema: `ShutdownActionResponse/Request` in `schemas/system.py` +- [x] Backend wiring: lifespan shutdown in `main.py` reads action, passes `restore_devices` flag to `processor_manager.stop_all()` +- [x] `processor_manager.stop_all(restore_devices: bool = True)` — when False, calls public `proc.cancel_task()` (defined on `TargetProcessor`) which awaits cancellation without restoring device state; skips `_restore_device_idle_state` loop. No reach into private `_task` attribute. +- [x] Frontend: hidden `