feat: BindableFloat — universal value source binding for all scalar properties
Lint & Test / test (push) Successful in 1m20s

Introduce BindableFloat abstraction that allows any numeric property to be
either a static value or dynamically driven by a ValueSource. Backward-compatible
serialization: plain float when unbound, {value, source_id} dict when bound.

Backend:
- storage/bindable.py — BindableFloat dataclass + bfloat() helper
- 25+ scalar properties converted across all entity types
- Runtime VS acquisition in ColorStripStreamManager for CSS bindings
- All stream hot loops use self.resolve() for live values
- KeyColorsColorStripStream now inherits ColorStripStream

Frontend:
- BindableScalarWidget (slider + VS picker toggle) for all editors
- TypeScript BindableFloat type + helpers
- Graph editor edges for all bindable properties
- Audio source channel IconSelect grid

Fixes: daylight longitude, candlelight wind_strength/candle_type from_dict
This commit is contained in:
2026-03-29 00:33:24 +03:00
parent 5f70302263
commit 8a17bb5caa
48 changed files with 2512 additions and 887 deletions
+38
View File
@@ -0,0 +1,38 @@
# BindableFloat — Universal Value Source Binding
## ALL PHASES COMPLETE
### Phase 1: Core Infrastructure
- [x] `storage/bindable.py` — BindableFloat dataclass + `bfloat()` extraction helper
- [x] WledOutputTarget, HALightOutputTarget, HALightMapping — brightness/transition
- [x] All 15 CSS source types — smoothing, sensitivity, intensity, scale, speed, etc.
- [x] API schemas + routes updated
- [x] output_target_store create/update
- [x] processor_manager add_target / add_ha_light_target
### Phase 2: Runtime Resolution
- [x] WledTargetProcessor — BindableFloat brightness, acquire/release value streams
- [x] HALightTargetProcessor — BindableFloat brightness + transition
- [x] All CSS streams use `bfloat()` to extract static values from BindableFloat properties
- [x] scene_activator — brightness_changed flag
- [x] ColorStripStream base class — `resolve()`, `set_value_stream()`, `remove_value_stream()`
- [x] ColorStripStreamManager — `_bind_value_streams()` / `_release_value_streams()` on acquire/release
- [x] All stream hot loops call `self.resolve(prop, static)` for dynamic runtime binding
- [x] KeyColorsColorStripStream — fixed to inherit from ColorStripStream
### Phase 3: Frontend
- [x] TypeScript BindableFloat type + `bindableValue()` / `bindableSourceId()` helpers
- [x] targets.ts, ha-light-targets.ts, color-strips.ts — save/load/display
- [x] Graph connections — value source edges for ALL bindable CSS properties
- [x] Graph layout — edge creation for CSS + target bindable properties
- [x] custom_components/select.py — HA integration backward compat
### Phase 4: BindableScalarWidget
- [x] `core/bindable-scalar.ts` — reusable widget (slider + VS picker toggle)
- [x] CSS styles (`.bindable-toggle`, `.bindable-slider-row`, `.bindable-vs-row`)
- [x] All 11 CSS editor sliders converted (smoothing, sensitivity, intensity, scale, speed, wind, temp_influence, timeout)
- [x] HTML templates updated with container divs