diff --git a/packages/request-handler/src/weather.ts b/packages/request-handler/src/weather.ts
index 5f5a097a4..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¤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,6 +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_mean[index],
};
}),
} satisfies Weather;
@@ -48,6 +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_mean: z.array(z.number()),
}),
});
@@ -66,5 +68,6 @@ export interface Weather {
sunset: string | undefined;
maxWindSpeed: number | undefined;
maxWindGusts: number | undefined;
+ humidity: number | undefined;
}[];
}
diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json
index ae89ad4df..391b235b9 100644
--- a/packages/translation/src/lang/en.json
+++ b/packages/translation/src/lang/en.json
@@ -2257,7 +2257,8 @@
"sunrise": "Sunrise",
"sunset": "Sunset",
"maxWindSpeed": "Max wind speed: {maxWindSpeed} {unit}",
- "maxWindGusts": "Max wind gusts: {maxWindGusts} {unit}"
+ "maxWindGusts": "Max wind gusts: {maxWindGusts} {unit}",
+ "humidity": "Humidity: {humidity}%"
},
"kind": {
"clear": "Clear",
diff --git a/packages/widgets/src/weather/component.tsx b/packages/widgets/src/weather/component.tsx
index 6e76ef8f2..27ab5d19e 100644
--- a/packages/widgets/src/weather/component.tsx
+++ b/packages/widgets/src/weather/component.tsx
@@ -1,7 +1,7 @@
"use client";
import { Box, Group, HoverCard, Stack, Text } from "@mantine/core";
-import { IconArrowDownRight, IconArrowUpRight, IconMapPin, IconWind } from "@tabler/icons-react";
+import { IconArrowDownRight, IconArrowUpRight, IconDroplets, IconMapPin, IconWind } from "@tabler/icons-react";
import combineClasses from "clsx";
import dayjs from "dayjs";
@@ -87,6 +87,12 @@ const DailyWeather = ({ options, weather }: WeatherProps) => {
)}
+ {weather.daily[0]?.humidity !== undefined && (
+
+
+ {t("dailyForecast.humidity", { humidity: weather.daily[0].humidity })}
+
+ )}
@@ -204,6 +210,7 @@ function Forecast({ weather, options }: WeatherProps) {
sunset={dayjs(dayWeather.sunset).format("HH:mm")}
maxWindSpeed={dayWeather.maxWindSpeed}
maxWindGusts={dayWeather.maxWindGusts}
+ humidity={dayWeather.humidity}
/>
diff --git a/packages/widgets/src/weather/icon.tsx b/packages/widgets/src/weather/icon.tsx
index fe4ad92b0..6153484f0 100644
--- a/packages/widgets/src/weather/icon.tsx
+++ b/packages/widgets/src/weather/icon.tsx
@@ -5,6 +5,7 @@ import {
IconCloudRain,
IconCloudSnow,
IconCloudStorm,
+ IconDroplets,
IconMoon,
IconQuestionMark,
IconSnowflake,
@@ -51,6 +52,7 @@ interface WeatherDescriptionProps {
sunset?: string;
maxWindSpeed?: number;
maxWindGusts?: number;
+ humidity?: number;
}
/**
@@ -78,6 +80,7 @@ export const WeatherDescription = ({
sunset,
maxWindSpeed,
maxWindGusts,
+ humidity,
}: WeatherDescriptionProps) => {
const t = useScopedI18n("widget.weather");
const tCommon = useScopedI18n("common");
@@ -97,6 +100,9 @@ export const WeatherDescription = ({
}>{`${tCommon("information.min")}: ${minTemp}`}
}>{`${t("dailyForecast.sunrise")}: ${sunrise}`}
}>{`${t("dailyForecast.sunset")}: ${sunset}`}
+ {humidity !== undefined && (
+ }>{t("dailyForecast.humidity", { humidity })}
+ )}
{maxWindSpeed !== undefined && (
}>
{t("dailyForecast.maxWindSpeed", {