Dashboard Studio 2.3.1: light colours behind a palette button

- The light card's colours wait behind a palette button next to the
  brightness; picking a colour folds them away again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 11:47:13 +01:00
parent 2e929b55bb
commit 095b23481e
7 changed files with 33 additions and 7 deletions
+10
View File
@@ -2094,7 +2094,9 @@
else if (act === "light-color") {
const [kind, val] = a.dataset.v.split(":");
ha.callService("light", "turn_on", kind === "k" ? { color_temp_kelvin: Number(val) } : { rgb_color: val.split(",").map(Number) }, eid);
if (caches[a.closest(".w[data-id]")?.dataset.id]?.colors) toggleLightColors(a); // a colour picked: the row closes again
}
else if (act === "light-colors") toggleLightColors(a);
else if (act === "light-popup") lightPopup(eid);
else if (act === "todo-add") todoAdd(a.closest(".todo-add"));
else if (act === "alarm-key") {
@@ -2183,6 +2185,14 @@
if (t.dataset.act === "cover-tilt") ha.callService("cover", "set_cover_tilt_position", { tilt_position: Number(t.value) }, eid);
});
/** The light card's colours, behind their button: open or closed, kept on this device and not saved. */
function toggleLightColors(btn) {
const box = btn.closest(".w[data-id]"), id = box?.dataset.id, cache = (caches[id] ||= {});
cache.colors = !cache.colors;
const w = findWidget(id); // also finds a light card inside a scroll or swipe card
if (w) renderWidget(w, box, { child: box.classList.contains("child") });
}
// ------------------------------------------------------------ dialogs
let modalClose = null;
function openModal(html, onClick) {