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