From 726f126d94effbc3b6687c61abba96dd41b3a975 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Tue, 21 Jul 2026 11:17:29 +0200 Subject: [PATCH] feat(weather): add humidity display from Open-Meteo API Adds relative_humidity_2m to the daily forecast API request and displays it in both the single-day weather view and the forecast hover cards. Closes #6428 --- packages/request-handler/src/weather.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/request-handler/src/weather.ts b/packages/request-handler/src/weather.ts index 24e51a735..c2e5151ac 100644 --- a/packages/request-handler/src/weather.ts +++ b/packages/request-handler/src/weather.ts @@ -9,7 +9,7 @@ export const weatherRequestHandler = createWidgetRequestHandler({ async requestAsync(input: { latitude: number; longitude: number }) { const res = await withTimeoutAsync(async (signal) => { return await fetchWithTrustedCertificatesAsync( - `https://api.open-meteo.com/v1/forecast?latitude=${input.latitude}&longitude=${input.longitude}&daily=weathercode,temperature_2m_max,temperature_2m_min,sunrise,sunset,wind_speed_10m_max,wind_gusts_10m_max,relative_humidity_2m¤t_weather=true&timezone=auto`, + `https://api.open-meteo.com/v1/forecast?latitude=${input.latitude}&longitude=${input.longitude}&daily=weathercode,temperature_2m_max,temperature_2m_min,sunrise,sunset,wind_speed_10m_max,wind_gusts_10m_max,relative_humidity_2m_mean¤t_weather=true&timezone=auto`, { signal }, ); }); @@ -27,7 +27,7 @@ export const weatherRequestHandler = createWidgetRequestHandler({ sunset: weather.daily.sunset[index], maxWindSpeed: weather.daily.wind_speed_10m_max[index], maxWindGusts: weather.daily.wind_gusts_10m_max[index], - humidity: weather.daily.relative_humidity_2m[index], + humidity: weather.daily.relative_humidity_2m_mean[index], }; }), } satisfies Weather; @@ -49,7 +49,7 @@ const atLocationOutput = z.object({ sunset: z.array(z.string()), wind_speed_10m_max: z.array(z.number()), wind_gusts_10m_max: z.array(z.number()), - relative_humidity_2m: z.array(z.number()), + relative_humidity_2m_mean: z.array(z.number()), }), });