Rework API input CSS: segments, remove led_count, HAOS light, test preview
API Input CSS rework:
- Remove led_count field from ApiInputColorStripSource (always auto-sizes)
- Add segment-based payload: solid, per_pixel, gradient modes
- Segments applied in order (last wins on overlap), auto-grow buffer
- Backward compatible: legacy {"colors": [...]} still works
- Pydantic validation: mode-specific field requirements
Test preview:
- Enable test preview button on api_input cards
- Hide LED/FPS controls for api_input (sender controls those)
- Show input source selector for all CSS tests (preselected)
- FPS sparkline chart using shared createFpsSparkline (same as target cards)
- Server only sends frames when push_generation changes (no idle frames)
HAOS integration:
- New light.py: ApiInputLight entity per api_input source (RGB + brightness)
- turn_on pushes solid segment, turn_off pushes fallback color
- Register wled_screen_controller.set_leds service for arbitrary segments
- New services.yaml with field definitions
- Coordinator: push_colors() and push_segments() methods
- Platform.LIGHT added to platforms list
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
</div>
|
||||
|
||||
<!-- LED count & FPS controls -->
|
||||
<div class="css-test-led-control">
|
||||
<div id="css-test-led-fps-group" class="css-test-led-control">
|
||||
<span id="css-test-led-group">
|
||||
<label for="css-test-led-input" data-i18n="color_strip.test.led_count">LEDs:</label>
|
||||
<input type="number" id="css-test-led-input" min="1" max="2000" step="1" value="100" class="css-test-led-input">
|
||||
@@ -62,6 +62,17 @@
|
||||
<button class="btn btn-icon btn-sm btn-secondary css-test-led-apply" onclick="applyCssTestSettings()" title="Apply" data-i18n-title="color_strip.test.apply">✓</button>
|
||||
</div>
|
||||
|
||||
<!-- FPS chart (for api_input sources) — matches target card sparkline -->
|
||||
<div id="css-test-fps-chart-group" class="target-fps-row" style="display:none">
|
||||
<div class="target-fps-sparkline">
|
||||
<canvas id="css-test-fps-chart"></canvas>
|
||||
</div>
|
||||
<div class="target-fps-label">
|
||||
<span id="css-test-fps-value" class="metric-value">0</span>
|
||||
<span class="target-fps-avg" id="css-test-fps-avg"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="css-test-status" class="css-test-status" data-i18n="color_strip.test.connecting">Connecting...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user