From 91cb650bf758f2594c2879bddaa2a017d7c6822a Mon Sep 17 00:00:00 2001 From: James Date: Sat, 14 Feb 2026 02:56:36 -0500 Subject: [PATCH] Temp alert <73/>76, CO2 warn >900 crit >1100 --- index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index d6d1480..5a7b1a9 100644 --- a/index.html +++ b/index.html @@ -373,8 +373,10 @@ async function updateSensors() { const d = await r.json(); const tempF = parseFloat(d.temperature); const tempC = ((tempF - 32) * 5/9).toFixed(1); - document.getElementById('s-temp').textContent = Math.round(tempF) + '°'; - document.getElementById('s-temp').title = tempC + '°C'; + const tempEl = document.getElementById('s-temp'); + tempEl.textContent = Math.round(tempF) + '°'; + tempEl.title = tempC + '°C'; + tempEl.className = 'sensor-val' + (tempF < 73 || tempF > 76 ? ' crit' : ''); const hum = parseFloat(d.humidity); const humEl = document.getElementById('s-hum'); @@ -384,7 +386,7 @@ async function updateSensors() { const co2 = parseInt(d.co2); const co2El = document.getElementById('s-co2'); co2El.textContent = co2; - co2El.className = 'sensor-val' + (co2 > 1500 ? ' crit' : co2 > 1000 ? ' warn' : ''); + co2El.className = 'sensor-val' + (co2 > 1100 ? ' crit' : co2 > 900 ? ' warn' : ''); } catch(e) { console.error('Sensor fetch failed:', e); } }