From 968cd1a669dd531b21e2ce7bb32a966ecfd41eb4 Mon Sep 17 00:00:00 2001 From: ztimson Date: Wed, 24 Jun 2026 17:05:10 -0400 Subject: [PATCH] Fixes --- server/src/forecast.mjs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/forecast.mjs b/server/src/forecast.mjs index 3f6c452..5d18c4d 100644 --- a/server/src/forecast.mjs +++ b/server/src/forecast.mjs @@ -166,14 +166,12 @@ export async function get24HourForecast(currentSensors) { precipitation_chance: Math.round(weather.precipChance * (1 - i * 0.02) * 100), // confidence decays }; + Object.assign(snapshot, getCelestialForecast(coords.latitude, coords.longitude, time)) return Object.assign(snapshot, getWeatherCondition(snapshot)); }); - // Pass through getCelestialForecast to enrich sun/moon data - const enriched = getCelestialForecast(coords.latitude, coords.longitude, slots); - // Second pass — apply solar heating now that we have sun_elevation per slot - for (const slot of enriched) { + for (const slot of slots) { if (slot.sunrise && slot.sunset) { const t = slot.time instanceof Date ? slot.time.getTime() : new Date(slot.time).getTime(); const rise = slot.sunrise instanceof Date ? slot.sunrise.getTime() : new Date(slot.sunrise).getTime(); @@ -193,7 +191,7 @@ export async function get24HourForecast(currentSensors) { slot.humidity_abs = absoluteHumidity(slot.temperature, slot.humidity); } - return enriched; + return slots; } function summarise(slots) {