Add configurable baud rate for Adalight with dynamic FPS hint
Baud rate is now a first-class device field, passed through the full stack: Device model → API schemas → routes → ProcessorManager → AdalightClient. The frontend shows a baud rate dropdown (115200–2M) for Adalight devices in both Add Device and Settings modals, with a live "Max FPS ≈ N" hint computed from LED count and baud rate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ def _device_to_response(device) -> DeviceResponse:
|
||||
device_type=device.device_type,
|
||||
led_count=device.led_count,
|
||||
enabled=device.enabled,
|
||||
baud_rate=device.baud_rate,
|
||||
capabilities=sorted(get_device_capabilities(device.device_type)),
|
||||
calibration=CalibrationSchema(**calibration_to_dict(device.calibration)),
|
||||
created_at=device.created_at,
|
||||
@@ -115,6 +116,7 @@ async def create_device(
|
||||
url=device_data.url,
|
||||
led_count=led_count,
|
||||
device_type=device_type,
|
||||
baud_rate=device_data.baud_rate,
|
||||
)
|
||||
|
||||
# Register in processor manager for health monitoring
|
||||
@@ -124,6 +126,7 @@ async def create_device(
|
||||
led_count=device.led_count,
|
||||
calibration=device.calibration,
|
||||
device_type=device.device_type,
|
||||
baud_rate=device.baud_rate,
|
||||
)
|
||||
|
||||
return _device_to_response(device)
|
||||
@@ -229,6 +232,7 @@ async def update_device(
|
||||
url=update_data.url,
|
||||
enabled=update_data.enabled,
|
||||
led_count=update_data.led_count,
|
||||
baud_rate=update_data.baud_rate,
|
||||
)
|
||||
|
||||
# Sync connection info in processor manager
|
||||
@@ -237,6 +241,7 @@ async def update_device(
|
||||
device_id,
|
||||
device_url=update_data.url,
|
||||
led_count=update_data.led_count,
|
||||
baud_rate=update_data.baud_rate,
|
||||
)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user