Commit Graph

9 Commits

Author SHA1 Message Date
8ad7f41d77 Add new pattern 'alternating_pulse' (ap): odd beat pulses color1 on odd bars, even beat pulses color2 on even bars; preserve existing alternating_phase; compact payloads and white guard retained 2025-10-04 01:58:02 +13:00
dc6d48a44b alternating_phase: compact per-bar overrides to stay <230 bytes; swap grouping flip; avoid pure white by sending 254,254,254 to work around strip edge-cases; add API logging improvements 2025-10-04 01:44:05 +13:00
43feb5938f backend: per-pattern parameters (n1-n4, delay) with persistence; REST responses include loaded params; logging of API inputs; alternating_phase: alternate colors between selected palette color 1/2 across bars with compact payload under 230 bytes; docs: add PER_PATTERN_PARAMETERS.md 2025-10-04 01:10:40 +13:00
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
aa9f892454 Add CONTROL_SERVER_HOST to allow external connections
- Add CONTROL_SERVER_HOST environment variable (default: 0.0.0.0)
- Server now binds to all interfaces by default for external access
- Update .env and .env.example with new host configuration
- Allows UI clients to connect from other machines on the network
2025-10-03 20:24:20 +13:00
Pi User
e78a8727b2 Add .env support for transport and sound device configuration
- Add python-dotenv support to control_server.py and sound.py
- Load TRANSPORT from environment variable (default: spi)
- Load AUDIO_INPUT_DEVICE from environment variable (default: 7)
- Load all port configurations from environment variables
- Update .env.example with comprehensive configuration options
- Create .env file with sensible defaults for Pi
- Transport, sound device, and network settings now configurable via .env
2025-10-03 20:19:55 +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
d57fce77fb update: misc changes 2025-10-01 23:31:00 +13:00
937fb1f2f9 Separate UI and control logic with WebSocket communication
- Create UI client (src/ui_client.py) with MIDI controller integration
- Create control server (src/control_server.py) with lighting logic
- Implement WebSocket protocol between UI and control server
- Add startup script (start_lighting_controller.py) for all components
- Update Pipfile with new scripts for separated architecture
- Add comprehensive documentation (README_SEPARATED.md)
- Fix LED connection stability with heartbeat mechanism
- Fix UI knob display and button highlighting
- Maintain backward compatibility with existing MIDI mappings
2025-09-28 12:36:25 +13:00