Improved single sensor UI + calibration breakout

This commit is contained in:
grove5_admin committed 2026-05-04 19:23:40 -07:00
1 parent c41db50fad
commit 95c62a2ad6
1 file changed
+10 -3
+10 -3
View File
@@ -133,12 +133,16 @@
}
// ── Chamber status chip ───────────────────────────────────────────────────
function co2eActive(ch: Chamber): boolean {
return ch.co2e_confidence !== undefined && ch.co2e_confidence !== 'uncalibrated';
}
function chamberStatus(ch: Chamber): { label: string; cls: 'good' | 'watch' | 'off' } {
if (ch.burn_in) return { label: 'calibrating', cls: 'off' };
const t = ch.environment.temp_c;
const rh = ch.environment.rh_pct;
const co2 = ch.type === 'colonization'
? (ch.environment.co2e_ppm ?? 0)
? (co2eActive(ch) ? (ch.environment.co2e_ppm ?? 0) : 0)
: (ch.environment.co2_ppm ?? 0);
const ok = inRange(t, RANGES.temp[ch.type])
&& inRange(rh, RANGES.humid[ch.type])
@@ -194,8 +198,9 @@
seriesFor: ch => sliceCh(ch, ch.type === 'colonization' ? 'co2e_ppm' : 'co2_ppm'),
rangeFor: ch => RANGES.co2[ch.type],
rangeLabel: ch => ch.type === 'colonization' ? '<1600 ppm ideal' : '<900 ppm ideal',
suppressed: ch => ch.type === 'colonization' && !co2eActive(ch),
hint: ch => ({
title: 'CO₂' + (ch.type === 'colonization' ? ' estimate' : ''),
title: 'CO₂' + (ch.type === 'colonization' ? 'e estimate' : ''),
body: 'Colonizing mycelium produces CO₂ as it grows. Fruiting mushrooms need fresh air — too much and caps come out long-stemmed and small. The fan exchanges filtered fresh air automatically.',
}),
},
@@ -297,7 +302,7 @@
{@const vpd = vpdFor(ch)}
{@const vpdOk = inRange(vpd, RANGES.vpd[ch.type])}
{@const co2val = ch.type === 'colonization'
? (ch.environment.co2e_ppm ?? null)
? (co2eActive(ch) ? (ch.environment.co2e_ppm ?? null) : null)
: (ch.environment.co2_ppm ?? null)}
<div class="scard" class:scard-burn={ch.burn_in}>
<!-- Two-row compact design -->
@@ -349,6 +354,7 @@
<span class="ch-dot" style="background:{ch.type === 'colonization' ? '#1c251d' : '#d5c48d'}"></span>
<span class="ch-name font-serif">{ch.label}</span>
<span class="ch-desc">{ch.type === 'colonization' ? 'dark & still' : 'lit & humid'}</span>
<span class="ch-sensor">{ch.health?.scd43_present ? 'BME690 · SCD43' : 'BME690'}</span>
{#if ch.burn_in}<span class="ch-burn">conditioning</span>{/if}
</div>
{/each}
@@ -963,6 +969,7 @@
}
.ch-name { font-size: 13px; color: var(--ink); font-weight: var(--fw-display); letter-spacing: -0.005em; }
.ch-desc { font-family: var(--font-serif); font-style: italic; font-size: 11.5px; color: var(--ink-muted); }
.ch-sensor { font-size: 10px; color: var(--ink-muted); opacity: 0.65; letter-spacing: 0.02em; }
.rows { display: flex; flex-direction: column; margin-top: 4px; }