Commit Graph

10 Commits

Author SHA1 Message Date
ec3c40d59c Fix numpy serialization and add comprehensive error logging
Some checks failed
Validate / validate (push) Failing after 9s
Server fixes:
- Fix numpy uint8 JSON serialization by converting to Python int
- Change WLED payload to flat array format [r,g,b,r,g,b,...]
- Add payload debugging logs (size, LED count, sample data)

Web UI improvements:
- Add comprehensive console logging for device errors
- Log actual error messages from state.errors array
- Log device operations (start/stop/add) with details
- Fix password field form validation warning

The HTTP API may have payload size limitations for large LED counts.
Consider UDP protocols (DDP/E1.31) for better real-time performance.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 20:25:58 +03:00
eca81e11cf Improve Web UI with footer, icon buttons, and better modals
Some checks failed
Validate / validate (push) Failing after 7s
- Add footer with author info (name, email, git repository link)
- Replace device action buttons with icons to save space:
  - Start/Stop: ▶️/⏹️, Settings: ⚙️, Calibrate: 📐, Remove: 🗑️
  - Added hover tooltips with translated text
  - Added btn-icon CSS class for compact styling
- Replace native browser confirm() with custom modal dialog:
  - Matches app theme and supports translations
  - Used for logout and device removal confirmations
  - Added confirm.title, confirm.yes, confirm.no translations
- Disable background scrolling when modals are open:
  - Added modal-open class to body when any modal opens
  - Prevents page scroll behind modals for better UX
  - Applied to all modals: login, settings, calibration, confirmation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 18:18:33 +03:00
110b3ae4ea Fix FOUC and improve Web UI i18n experience
Some checks failed
Validate / validate (push) Failing after 8s
- Fix Flash of Unstyled Content (FOUC) by hiding page until translations load
  - Hide body initially with visibility:hidden
  - Show content after translations are applied to avoid English flash
- Fix authenticated indicator layout with white-space:nowrap
- Add "●" symbol to translation files to prevent disappearance on reload
- Enable network access by binding server to 0.0.0.0 in test config
- Simplify test config API keys to single entry

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:53:02 +03:00
5405e81cba Fix display refresh rate API endpoint
Some checks failed
Validate / validate (push) Failing after 8s
- Updated get_displays() to use get_available_displays() function from screen_capture module
- Removed duplicate display detection code in routes.py
- Now properly returns refresh_rate field in display API responses
- Removed unused get_monitor_names import

This fixes the "undefinedHz" issue in the Web UI by ensuring the backend properly provides refresh rate data.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:30:29 +03:00
e2a6a41b93 Add Claude development instructions for server
Some checks failed
Validate / validate (push) Failing after 8s
- Created CLAUDE.md with server restart policy and development workflow
- Includes guidelines on when to restart after code changes
- Documents common development tasks with step-by-step instructions
- Provides project structure reference
- Helps prevent issues with running old code after updates

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:23:54 +03:00
c1259a9a7f Add display refresh rate detection and display
Some checks failed
Validate / validate (push) Failing after 8s
- Added get_monitor_refresh_rates() function in monitor_names.py using Windows ctypes/DEVMODE to detect monitor refresh rates
- Updated DisplayInfo dataclass and Pydantic schema to include refresh_rate field (in Hz)
- Modified get_available_displays() to detect and include refresh rates (defaults to 60Hz on non-Windows or if detection fails)
- Added refresh rate display in Web UI between Resolution and Position
- Added translations for refresh rate label (displays.refresh_rate) in English and Russian locales
- Cross-platform compatible: gracefully falls back to 60Hz default on non-Windows systems

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:18:35 +03:00
c40c8b9d26 Fix localization: Update dynamic content when language changes
Some checks failed
Validate / validate (push) Failing after 9s
Fixed issues where device details and display badges were not updating
when switching languages:

Changes:
- Updated updateAllText() to reload displays and devices when language changes
- Added translations to createDeviceCard() for all dynamic text:
  * Device status badges (Processing/Idle)
  * Device info labels (URL, LED Count, Display)
  * Metrics labels (Actual FPS, Target FPS, Frames, Errors)
  * Button labels (Start, Stop, Settings, Calibrate, Remove)
- Updated loadDevices() error messages to use translations
- Added missing translations to locale files:
  * device.metrics.actual_fps, target_fps, frames, errors

Now when switching between English and Russian, all device cards and
display information updates correctly, including:
- Primary/Secondary display badges
- Device status badges
- All labels and button text
- Metrics labels when processing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:14:06 +03:00
38018750ed Add internationalization (i18n) support with English and Russian translations
Some checks failed
Validate / validate (push) Failing after 7s
Implemented localization system similar to the media-server project pattern:
- Created locale JSON files for English (en.json) and Russian (ru.json)
- Added complete translations for all UI elements, buttons, labels, and messages
- Implemented locale management system with browser locale detection
- Added language selector dropdown in header
- Applied data-i18n, data-i18n-title, and data-i18n-placeholder attributes
- Translations stored in localStorage and persist across sessions
- Automatic language detection from browser settings
- All dynamic content (displays, devices, modals) now uses translation function

Translations cover:
- Authentication (login/logout)
- Displays (layout visualization, cards, labels)
- Devices (management, status, actions)
- Settings modal (brightness, device configuration)
- Calibration modal (LED mapping, testing)
- Error messages and notifications
- Server status and version information

The implementation uses:
- Simple t(key, params) translation function with parameter substitution
- Async locale loading from /static/locales/{locale}.json
- updateAllText() to refresh all UI elements when language changes
- Fallback to English if translation file fails to load

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:09:50 +03:00
6a0cc12ca1 Add visual display layout and enhanced display information in Web UI
Some checks failed
Validate / validate (push) Failing after 14s
- Visual display layout visualization showing all monitors in their relative positions
- Displays are scaled proportionally and positioned based on actual coordinates
- Primary displays marked with star icon and green borders
- Secondary displays with gray borders
- Hover effects on display visualization with detailed tooltips
- Color-coded legend explaining primary/secondary displays
- Enhanced display cards with primary/secondary badges
- Added display index to display cards for clarity
- Added lightbulb emoji favicon for browser tab

This makes it much easier to understand multi-monitor setups and identify
which physical monitor corresponds to which display index when configuring
WLED devices.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 17:03:20 +03:00
d471a40234 Initial commit: WLED Screen Controller with FastAPI server and Home Assistant integration
Some checks failed
Validate / validate (push) Failing after 1m6s
This is a complete WLED ambient lighting controller that captures screen border pixels
and sends them to WLED devices for immersive ambient lighting effects.

## Server Features:
- FastAPI-based REST API with 17+ endpoints
- Real-time screen capture with multi-monitor support
- Advanced LED calibration system with visual GUI
- API key authentication with labeled tokens
- Per-device brightness control (0-100%)
- Configurable FPS (1-60), border width, and color correction
- Persistent device storage (JSON-based)
- Comprehensive Web UI with dark/light themes
- Docker support with docker-compose
- Windows monitor name detection via WMI (shows "LG ULTRAWIDE" etc.)

## Web UI Features:
- Device management (add, configure, remove WLED devices)
- Real-time status monitoring with FPS metrics
- Settings modal for device configuration
- Visual calibration GUI with edge testing
- Brightness slider per device
- Display selection with friendly monitor names
- Token-based authentication with login/logout
- Responsive button layout

## Calibration System:
- Support for any LED strip layout (clockwise/counterclockwise)
- 4 starting position options (corners)
- Per-edge LED count configuration
- Visual preview with starting position indicator
- Test buttons to light up individual edges
- Smart LED ordering based on start position and direction

## Home Assistant Integration:
- Custom HACS integration
- Switch entities for processing control
- Sensor entities for status and FPS
- Select entities for display selection
- Config flow for easy setup
- Auto-discovery of devices from server

## Technical Stack:
- Python 3.11+
- FastAPI + uvicorn
- mss (screen capture)
- httpx (async WLED client)
- Pydantic (validation)
- WMI (Windows monitor detection)
- Structlog (logging)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 16:38:27 +03:00