Add LED device abstraction layer for multi-controller support

Introduce abstract LEDClient base class with factory pattern so new
LED controller types can plug in alongside WLED. ProcessorManager is
now fully type-agnostic — all device-specific logic (health checks,
state snapshot/restore, fast send) lives behind the LEDClient interface.

- New led_client.py: LEDClient ABC, DeviceHealth, factory functions
- WLEDClient inherits LEDClient, encapsulates WLED health checks and state management
- device_type field on Device storage model (defaults to "wled")
- Rename target_type "wled" → "led" with backward-compat migration
- Frontend: "WLED" tab → "LED", device type badge, type selector in
  add-device modal, device type shown in target device dropdown
- All wled_* API fields renamed to device_* for generic naming

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 12:41:02 +03:00
parent afce183f79
commit b5a6885126
18 changed files with 667 additions and 346 deletions

View File

@@ -343,6 +343,15 @@ section {
gap: 4px;
}
.device-type-badge {
font-size: 10px;
font-weight: 700;
padding: 1px 6px;
border-radius: 3px;
background: rgba(255, 255, 255, 0.15);
letter-spacing: 0.5px;
}
.channel-indicator {
display: inline-flex;
gap: 2px;
@@ -680,7 +689,14 @@ select {
color: var(--text-color);
font-size: 1rem;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
transition: border-color 0.2s, box-shadow 0.2s;
transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
input[type="number"]:disabled,
input[type="password"]:disabled,
select:disabled {
opacity: 0.4;
cursor: not-allowed;
}
input[type="range"] {
@@ -1167,6 +1183,35 @@ input:-webkit-autofill:focus {
font-size: 14px;
}
.preview-screen-border-width {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
font-weight: 600;
}
.preview-screen-border-width label {
white-space: nowrap;
}
.preview-screen-border-width input {
width: 52px;
padding: 2px 4px;
font-size: 12px;
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 3px;
background: rgba(255, 255, 255, 0.15);
color: white;
text-align: center;
}
.preview-screen-border-width input:focus {
outline: none;
border-color: rgba(255, 255, 255, 0.7);
background: rgba(255, 255, 255, 0.25);
}
.preview-screen-total {
font-size: 16px;
font-weight: 600;