fix: accurate port banner and tkinter graceful fallback
Some checks failed
Build Release / build-linux (push) Successful in 1m24s
Build Release / create-release (push) Successful in 1s
Lint & Test / test (push) Failing after 13s
Build Release / build-windows (push) Successful in 1m35s
Build Release / build-docker (push) Failing after 9s

- Move startup banner into main.py so it shows the actual configured
  port instead of a hardcoded 8080 in the launcher scripts
- Wrap tkinter import in try/except so embedded Python (which lacks
  tkinter) logs a warning instead of crashing the overlay thread
This commit is contained in:
2026-03-22 03:30:19 +03:00
parent 7c80500d48
commit 564e4c9c9c
4 changed files with 11 additions and 23 deletions

View File

@@ -243,22 +243,11 @@ cd /d "%~dp0"
set PYTHONPATH=%~dp0app\src
set WLED_CONFIG_PATH=%~dp0app\config\default_config.yaml
:: Read port from env var or use default
if "%WLED_SERVER__PORT%"=="" set WLED_SERVER__PORT=8080
:: Create data directory if missing
if not exist "%~dp0data" mkdir "%~dp0data"
if not exist "%~dp0logs" mkdir "%~dp0logs"
echo.
echo =============================================
echo LedGrab v${VERSION_CLEAN}
echo Open http://localhost:%WLED_SERVER__PORT% in your browser
echo =============================================
echo.
:: Start the server — uses config from WLED_CONFIG_PATH, port from config or env
start "" /b cmd /c "timeout /t 2 /nobreak >nul && start http://localhost:%WLED_SERVER__PORT%"
:: Start the server — reads port from config, prints its own banner
"%~dp0python\python.exe" -m wled_controller.main
pause