fix(webpage): hide Temperatures section when setup has no temperature data
CI for csaxs_bec / test (pull_request) Successful in 28m21s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 7m3s

renderInstrument() checked setup.temperatures for truthiness, but an
empty JS object is truthy, so LamNI's deliberately-empty temperatures
dict (it has no monitoring device) still rendered an empty
"Temperatures" heading/table. flomni only worked by coincidence since
its _TEMP_MAP always has entries. Adds a hasTemps check
(Object.keys(...).length>0), mirroring the existing hasParams idiom
one line above for the same card.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit was merged in pull request #269.
This commit is contained in:
x01dc
2026-07-22 16:01:50 +02:00
co-authored by Claude Sonnet 5
parent 7717efd19a
commit 851df3619b
@@ -2610,7 +2610,8 @@ function renderInstrument(setup){{
const card=document.getElementById('instrument-card'),grid=document.getElementById('instrument-grid');
const cp=(setup&&setup.current_params)||null;
const hasParams=cp&&Object.keys(cp).length>0;
if(!setup||(!setup.temperatures&&!hasParams)){{card.style.display='none';return;}}
const hasTemps=setup&&setup.temperatures&&Object.keys(setup.temperatures).length>0;
if(!setup||(!hasTemps&&!hasParams)){{card.style.display='none';return;}}
card.style.display='';
let html='';
if(hasParams){{
@@ -2622,7 +2623,7 @@ function renderInstrument(setup){{
html+=buildParamRows(cp);
html+='</table></div>';
}}
if(setup.temperatures){{
if(hasTemps){{
html+='<div class="instrument-section"><h3>Temperatures (&deg;C)</h3><table class="kv-table">';
for(const[k,v] of Object.entries(setup.temperatures)){{
const cls=v==null?' class="temp-null"':'';