fix(led): colour the active core from its resolved light

Keep off and unavailable presentation unchanged. Extend the rendered colour
and surface matrix and retain the independent white-source geometry oracle.

Issue: #790
User-Visible: yes
This commit is contained in:
Matysh
2026-10-03 23:54:21 +03:00
parent 24e48935c3
commit 181b61ae8e
11 changed files with 156 additions and 32 deletions
+4 -4
View File
@@ -14276,13 +14276,13 @@ const MUTANT_DEFINITIONS = [
}],
},
{
id: 'led-core-coloured-under-glow',
id: 'led-core-white-under-glow',
guard: 'node demo/smoke_led_strip_glow.mjs',
because: "#780 ТЗ §3: with Glow the core stays white and the colour is the field; only without Glow the core takes the source colour",
because: '#790: the actual SVG core must match the resolved field colour across live HA/config updates, with or without Glow; this needs the rendered DOM and its update lifecycle',
patches: [{
file: 'src/led-strip-runtime.ts',
find: ": view.state === 'on' && !view.glow && view.appearance ? view.appearance.c : CORE_IDLE;",
replace: ": view.state === 'on' && view.appearance ? view.appearance.c : CORE_IDLE;",
find: ": view.state === 'on' && view.appearance ? view.appearance.c : CORE_IDLE;",
replace: ": view.state === 'on' && !view.glow && view.appearance ? view.appearance.c : CORE_IDLE;",
}],
},
{