Added daytime property

This commit is contained in:
2026-06-24 15:51:46 -04:00
parent a5b4f7da45
commit 9e901f8266
3 changed files with 3 additions and 4 deletions

View File

@@ -152,7 +152,7 @@ export async function get24HourForecast(currentSensors) {
const wind_speed = forecastWind(seedWind, pressureTrend);
const snapshot = {
time: time.toISOString().slice(0, 16), // "YYYY-MM-DDTHH:MM"
time,
daytime: false,
temperature,
humidity,
@@ -205,7 +205,7 @@ function summarise(slots) {
// Most frequent label/code by occurrence
const labelCount = {}
for (const s of slots.filter(s => s.daytime)) labelCount[s.label] = (labelCount[s.label] || 0) + 1
for (const s of slots) 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)