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
This commit is contained in:
27
.env.example
27
.env.example
@@ -1,5 +1,8 @@
|
||||
# Lighting Controller Configuration
|
||||
|
||||
# ==============================
|
||||
# WebSocket Configuration
|
||||
# ==============================
|
||||
# WebSocket URI for the control server
|
||||
# Used by UI client and test scripts to connect to the control server
|
||||
#
|
||||
@@ -11,3 +14,27 @@ CONTROL_SERVER_URI=ws://10.42.0.1:8765
|
||||
#
|
||||
# For custom IP (if your Pi has a different address):
|
||||
# CONTROL_SERVER_URI=ws://YOUR_PI_IP:8765
|
||||
|
||||
# Control server WebSocket port
|
||||
CONTROL_SERVER_PORT=8765
|
||||
|
||||
# ==============================
|
||||
# Transport Configuration
|
||||
# ==============================
|
||||
# Transport method for LED communication
|
||||
# Options: spi, websocket
|
||||
TRANSPORT=spi
|
||||
|
||||
# ==============================
|
||||
# Sound Detection Configuration
|
||||
# ==============================
|
||||
# Audio input device index (use sound.py to list available devices)
|
||||
AUDIO_INPUT_DEVICE=7
|
||||
|
||||
# MIDI TCP configuration
|
||||
MIDI_TCP_HOST=127.0.0.1
|
||||
MIDI_TCP_PORT=65432
|
||||
|
||||
# Sound control server configuration
|
||||
SOUND_CONTROL_HOST=127.0.0.1
|
||||
SOUND_CONTROL_PORT=65433
|
||||
|
||||
Reference in New Issue
Block a user