Add DDP protocol support, fix event loop blocking, and add LED offset calibration
Some checks failed
Validate / validate (push) Failing after 8s

- Add DDP client for LED strips >500 LEDs (UDP port 4048), with automatic
  fallback from HTTP JSON API when LED count exceeds limit
- Wrap blocking operations (screen capture, image processing) in
  asyncio.to_thread() to prevent event loop starvation
- Turn on WLED device and enable live mode when starting DDP streaming
- Add LED strip offset field to calibration (rotates color array to match
  physical LED position vs start corner)
- Add server management scripts (start, stop, restart, background start)
- Fix WebUI auth error handling and auto-refresh loop
- Add development API key to default config
- Add i18n translations for offset field (en/ru)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 12:44:06 +03:00
parent ec3c40d59c
commit 579821a69b
15 changed files with 504 additions and 48 deletions

View File

@@ -0,0 +1,24 @@
@echo off
REM WLED Screen Controller Restart Script
REM This script restarts the WLED screen controller server
echo Restarting WLED Screen Controller...
echo.
REM Stop the server first
echo [1/2] Stopping server...
call "%~dp0\stop-server.bat"
REM Wait a moment
timeout /t 2 /nobreak >nul
REM Change to parent directory (server root)
cd /d "%~dp0\.."
REM Start the server
echo.
echo [2/2] Starting server...
python -m uvicorn wled_controller.main:app --host 0.0.0.0 --port 8080
REM If the server exits, pause to show any error messages
pause

View File

@@ -0,0 +1,7 @@
Set WshShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
' Get parent folder of scripts folder (server root)
WshShell.CurrentDirectory = FSO.GetParentFolderName(FSO.GetParentFolderName(WScript.ScriptFullName))
WshShell.Run "python -m uvicorn wled_controller.main:app --host 0.0.0.0 --port 8080", 0, False
Set FSO = Nothing
Set WshShell = Nothing

View File

@@ -0,0 +1,15 @@
@echo off
REM WLED Screen Controller Startup Script
REM This script starts the WLED screen controller server
echo Starting WLED Screen Controller...
echo.
REM Change to the server directory (parent of scripts folder)
cd /d "%~dp0\.."
REM Start the server
python -m uvicorn wled_controller.main:app --host 0.0.0.0 --port 8080
REM If the server exits, pause to show any error messages
pause

View File

@@ -0,0 +1,19 @@
@echo off
REM WLED Screen Controller Stop Script
REM This script stops the running WLED screen controller server
echo Stopping WLED Screen Controller...
echo.
REM Find and kill Python processes running wled_controller.main
for /f "tokens=2" %%i in ('tasklist /FI "IMAGENAME eq python.exe" /FO LIST ^| findstr /B "PID:"') do (
wmic process where "ProcessId=%%i" get CommandLine 2>nul | findstr /C:"wled_controller.main" >nul
if not errorlevel 1 (
taskkill /PID %%i /F
echo WLED controller process (PID %%i) terminated.
)
)
echo.
echo Done! WLED Screen Controller stopped.
pause