Add WLED auto-discovery via mDNS with zeroconf
Scan the local network for WLED devices advertising _wled._tcp.local. and present them in the Add Device modal for one-click selection. - New discovery.py: async mDNS browse + parallel /json/info enrichment - GET /api/v1/devices/discover endpoint with already_added dedup - Header scan button (magnifying glass icon) in add-device modal - Discovered devices show name, IP, LED count, version; click to fill form - en/ru locale strings for discovery UI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -113,3 +113,24 @@ class DeviceStateResponse(BaseModel):
|
||||
device_error: Optional[str] = Field(None, description="Last health check error")
|
||||
test_mode: bool = Field(default=False, description="Whether calibration test mode is active")
|
||||
test_mode_edges: List[str] = Field(default_factory=list, description="Currently lit edges in test mode")
|
||||
|
||||
|
||||
class DiscoveredDeviceResponse(BaseModel):
|
||||
"""A single device found via network discovery."""
|
||||
|
||||
name: str = Field(description="Device name (from mDNS or firmware)")
|
||||
url: str = Field(description="Device URL")
|
||||
device_type: str = Field(default="wled", description="Device type")
|
||||
ip: str = Field(description="IP address")
|
||||
mac: str = Field(default="", description="MAC address")
|
||||
led_count: Optional[int] = Field(None, description="LED count (if reachable)")
|
||||
version: Optional[str] = Field(None, description="Firmware version")
|
||||
already_added: bool = Field(default=False, description="Whether this device is already in the system")
|
||||
|
||||
|
||||
class DiscoverDevicesResponse(BaseModel):
|
||||
"""Response from device discovery scan."""
|
||||
|
||||
devices: List[DiscoveredDeviceResponse] = Field(description="Discovered devices")
|
||||
count: int = Field(description="Total devices found")
|
||||
scan_duration_ms: float = Field(description="How long the scan took in milliseconds")
|
||||
|
||||
Reference in New Issue
Block a user