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:
31
server/src/wled_controller/demo.py
Normal file
31
server/src/wled_controller/demo.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Demo mode entry point.
|
||||
|
||||
Usage:
|
||||
python -m wled_controller.demo
|
||||
|
||||
Starts the server in demo mode with virtual devices, engines, and seed data.
|
||||
Equivalent to setting WLED_DEMO=true before starting the regular server.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
os.environ["WLED_DEMO"] = "true"
|
||||
|
||||
import uvicorn
|
||||
from wled_controller.config import get_config
|
||||
|
||||
config = get_config()
|
||||
uvicorn.run(
|
||||
"wled_controller.main:app",
|
||||
host=config.server.host,
|
||||
port=config.server.port,
|
||||
log_level=config.server.log_level.lower(),
|
||||
reload=False,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user