Files
lighting-controller/Pipfile
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

44 lines
1.7 KiB
TOML

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
aiohttp = "*"
websockets = "*"
spidev = "*"
watchfiles = "*"
async-tkinter-loop = "*"
mido = "*"
python-rtmidi = "*"
pyaudio = "*"
aubio = "*"
websocket-client = "*"
python-dotenv = "*"
[dev-packages]
[requires]
python_version = "3.11"
[scripts]
run = "python src/main.py"
ui = "python src/ui_client.py"
control = "python src/control_server.py"
control-spi = "python src/control_server.py --transport spi"
control-ws = "python src/control_server.py --transport websocket"
sound = "python src/sound.py"
dev-ui = 'watchfiles "python src/ui_client.py" src'
dev-control = 'watchfiles --args "--transport spi" "python src/control_server.py" src'
dev-control-spi = 'watchfiles --args "--transport spi" "python src/control_server.py" src'
dev-control-ws = 'watchfiles --args "--transport websocket" "python src/control_server.py" src'
install = "pipenv install"
install-system = "bash -c 'sudo apt-get update && sudo apt-get install -y python3-spidev python3-pip python3-dev portaudio19-dev libasound2-dev'"
monitor-esp32 = "bash -c 'source $HOME/esp/esp-idf/export.sh && cd esp32 && idf.py -p ${ESPPORT:-/dev/ttyACM0} monitor'"
build-esp32 = "bash -c 'source $HOME/esp/esp-idf/export.sh && cd esp32 && idf.py build'"
flash-esp32 = "bash -c 'source $HOME/esp/esp-idf/export.sh && cd esp32 && idf.py -p $ESPPORT -b ${ESPSPEED:-460800} flash'"
watch-esp32 = "watchfiles 'bash -c \"source $HOME/esp/esp-idf/export.sh && cd esp32 && idf.py -p ${ESPPORT:-/dev/ttyACM0} -b ${ESPSPEED:-460800} flash monitor\"' esp32/main"
send-json = "python test/send_json.py"
send-net = "python test/test_networking.py"
sound-run = "python src/sound.py"