Add demo mode: virtual hardware sandbox for testing without real devices
Demo mode provides a complete sandbox environment with: - Virtual capture engine (radial rainbow test pattern on 3 displays) - Virtual audio engine (synthetic music-like audio on 2 devices) - Virtual LED device provider (strip/60, matrix/256, ring/24 LEDs) - Isolated data directory (data/demo/) with auto-seeded sample entities - Dedicated config (config/demo_config.yaml) with pre-configured API key - Frontend indicator (DEMO badge + dismissible banner) - Engine filtering (only demo engines visible in demo mode) - Separate entry point: python -m wled_controller.demo (port 8081) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
30
plans/demo-mode/CONTEXT.md
Normal file
30
plans/demo-mode/CONTEXT.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Feature Context: Demo Mode
|
||||
|
||||
## Current State
|
||||
Starting implementation. No changes made yet.
|
||||
|
||||
## Key Architecture Notes
|
||||
- `EngineRegistry` (class-level dict) holds capture engines, auto-registered in `capture_engines/__init__.py`
|
||||
- `AudioEngineRegistry` (class-level dict) holds audio engines, auto-registered in `audio/__init__.py`
|
||||
- `LEDDeviceProvider` instances registered via `register_provider()` in `led_client.py`
|
||||
- Already has `MockDeviceProvider` + `MockClient` (device type "mock") for testing
|
||||
- Config is `pydantic_settings.BaseSettings` in `config.py`, loaded from YAML + env vars
|
||||
- Frontend header in `templates/index.html` line 27-31: title + version badge
|
||||
- Frontend bundle: `cd server && npm run build` (esbuild)
|
||||
- Data stored as JSON in `data/` directory, paths configured via `StorageConfig`
|
||||
|
||||
## Temporary Workarounds
|
||||
- None yet
|
||||
|
||||
## Cross-Phase Dependencies
|
||||
- Phase 1 (config flag) is foundational — all other phases depend on `is_demo_mode()`
|
||||
- Phase 2 & 3 (engines) can be done independently of each other
|
||||
- Phase 4 (seed data) depends on knowing what entities to create, which is informed by phases 2-3
|
||||
- Phase 5 (frontend) depends on the system info API field from phase 1
|
||||
- Phase 6 (engine resolution) depends on engines existing from phases 2-3
|
||||
|
||||
## Implementation Notes
|
||||
- Demo mode activated via `WLED_DEMO=true` env var or `demo: true` in YAML config
|
||||
- Isolated data directory `data/demo/` keeps demo entities separate from real config
|
||||
- Demo engines use `ENGINE_TYPE = "demo"` and are always registered but return `is_available() = True` only in demo mode
|
||||
- The existing `MockDeviceProvider`/`MockClient` can be reused or extended for demo device output
|
||||
Reference in New Issue
Block a user