From ddab0db7819b665cd82ef6786d8630118bae35d5 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 17 Apr 2026 16:05:26 -0400 Subject: [PATCH] feat(weather): add hourly precipitation summaries and peak timing to weather card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fetch hourly precipitation probabilities from Open-Meteo alongside daily forecasts. Generate human-readable precip summaries ("Rain likely 2–5 PM", "Rain likely all day") for today and each forecast day. Display today's summary as a styled callout and show peak precipitation hour in forecast rows. Also fix briefing pipeline to parse all weather location rows (not just first). Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/WeatherCard.vue | 45 ++++++++- .../services/briefing_pipeline.py | 6 +- src/fabledassistant/services/weather.py | 91 ++++++++++++++++--- tests/test_weather_service.py | 65 ++++++++++++- 4 files changed, 188 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/WeatherCard.vue b/frontend/src/components/WeatherCard.vue index 1fbb247..dac6b57 100644 --- a/frontend/src/components/WeatherCard.vue +++ b/frontend/src/components/WeatherCard.vue @@ -9,6 +9,8 @@ interface ForecastDay { precip_probability: number | null precip_mm: number | null windspeed_max: number + precip_summary?: string + precip_peak_hour?: string } interface WeatherData { @@ -21,6 +23,7 @@ interface WeatherData { yesterday_high: number | null yesterday_low: number | null wind_unit?: string + precip_summary?: string | null forecast: ForecastDay[] } @@ -68,6 +71,11 @@ const fetchedAtLabel = computed(() => { return '' } }) + +function hasPrecip(day: ForecastDay): boolean { + return (day.precip_probability != null && day.precip_probability > 0) || + (day.precip_mm != null && day.precip_mm > 0) +}