From 2da06ca4623868387083c3e5fe25ba1d936fa88f Mon Sep 17 00:00:00 2001 From: Richard Sauer Date: Wed, 8 Apr 2026 18:48:29 +1000 Subject: [PATCH] Move Hot Fan to Speed Control, rename pages, burner auto-enables fan --- templates/editor.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/templates/editor.html b/templates/editor.html index 21975f1..5da5fef 100644 --- a/templates/editor.html +++ b/templates/editor.html @@ -840,8 +840,17 @@ function toggleSim(id) { if (!simState[id]) simState[id] = {on: false, value: 0}; simState[id].on = !simState[id].on; - // If this is an automation card, activate/deactivate all its rules + // Burner turns on Hot Fan automatically const card = findCard(id); + if (card && card.type === 'burner') { + const fanCard = findCardByLabel('Hot Fan'); + if (fanCard) { + if (!simState[fanCard.id]) simState[fanCard.id] = {on: false, value: fanCard.sp_default || 50}; + simState[fanCard.id].on = simState[id].on; + } + } + + // If this is an automation card, activate/deactivate all its rules if (card && card.type === 'automation' && card.rules) { card.rules.forEach(r => { if (!r.target) return; @@ -894,6 +903,10 @@ function findCard(id) { for (const p of layout.pages) { const c = p.cards.find(x => x.id === id); if (c) return c; } return null; } +function findCardByLabel(label) { + for (const p of layout.pages) { const c = p.cards.find(x => x.label === label); if (c) return c; } + return null; +} // ══════════════════════════════════════════════════════ // COMMENTS