Commit Graph

4 Commits

Author SHA1 Message Date
Pi User
6f9133b43e Add complete REST API for lighting control
- Migrated from websockets to aiohttp for unified HTTP/WebSocket server
- Added REST endpoints: /api/pattern, /api/parameters, /api/state, /api/tempo/reset
- Implemented color palette API with 8-slot system and selected colors
- First selected color (index 0) is used as primary RGB for patterns
- All operations now available via simple HTTP requests (no WebSocket needed)
- Added comprehensive documentation: FRONTEND_API.md, COLOR_PALETTE_API.md
- Added test scripts: test_rest_api.sh, test_color_patterns.py
- Updated test/test_control_server.py for new /ws WebSocket path
- Configuration persistence via lighting_config.json
- Pattern parameters (n1-n4, brightness, delay) controllable via API
- WebSocket still available at /ws for legacy support
2025-10-03 23:38:54 +13:00
Pi User
8f183b284c Add .env support for test scripts
- Update test_control_server.py to use python-dotenv
- Read CONTROL_SERVER_URI from environment variable
- Create .env.example with configuration examples
- Test scripts now respect .env configuration for WebSocket URI
2025-10-03 20:13:25 +13:00
Pi User
e4a83e8f0d Add segmented_movement pattern with n4 parameter support
- Add n4 parameter to control server, LED bar receiver, and test script
- Create segmented_movement pattern with alternating forward/backward movement
- Pattern supports n1 (segment length), n2 (spacing), n3 (forward speed), n4 (backward speed)
- Fix test script to send all messages instead of just the first one
- Add segmented_movement to patterns_needing_params for proper parameter transmission
- Pattern intelligently handles all cases: alternating, forward-only, backward-only, or static
- Implements repeating segments with configurable spacing across LED strip
2025-10-03 19:54:43 +13:00
Pi User
f4e9f8fff7 fix: prioritize delay_change in control server test 2025-10-02 20:49:20 +13:00