From db29f0fdec7fd0a7780aa0499bc7db5147e56938 Mon Sep 17 00:00:00 2001 From: ztimson Date: Wed, 24 Jun 2026 16:37:31 -0400 Subject: [PATCH] Summarize with day time only --- server/src/forecast.mjs | 4 +++- server/src/server.mjs | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/forecast.mjs b/server/src/forecast.mjs index cbbe938..81ec773 100644 --- a/server/src/forecast.mjs +++ b/server/src/forecast.mjs @@ -207,7 +207,9 @@ function summarise(slots) { // Most frequent label/code by occurrence const labelCount = {} - for (const s of slots) labelCount[s.label] = (labelCount[s.label] || 0) + 1 + for (const s of slots) { + if(s.daytime) labelCount[s.label] = (labelCount[s.label] || 0) + 1 + } const label = Object.entries(labelCount).sort((a, b) => b[1] - a[1])[0][0] const dominant = slots.find(s => s.label === label) diff --git a/server/src/server.mjs b/server/src/server.mjs index ff1d933..09a66ee 100644 --- a/server/src/server.mjs +++ b/server/src/server.mjs @@ -46,7 +46,6 @@ app.get('/api/current', async (req, res) => { // Merge forecast summary fields — sensor readings take priority const forecast = await getForecast(); - console.log(forecast?.summary); const merged = { ...(forecast?.summary ? { precipitation_chance: forecast.summary.precipitation_chance,