Temp alert <73/>76, CO2 warn >900 crit >1100

This commit is contained in:
James 2026-02-14 02:56:36 -05:00
parent c840d6e74d
commit 91cb650bf7
1 changed files with 5 additions and 3 deletions

View File

@ -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); }
}