Summarize with day time only

This commit is contained in:
2026-06-24 16:37:31 -04:00
parent 83c2e655f6
commit db29f0fdec
2 changed files with 3 additions and 2 deletions

View File

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

View File

@@ -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,