feat: combine hourly weather into single feed item (#100)

* feat: combine hourly weather into single feed item

Co-authored-by: Ona <no-reply@ona.com>

* fix: use worst-case timeRelevance, improve tests

- Use most urgent timeRelevance across hours instead of
  hardcoded Ambient
- Use HourlyWeatherData type in test casts
- Add test for averaged urgency with mixed conditions

Co-authored-by: Ona <no-reply@ona.com>

---------

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-03-29 14:54:14 +01:00
committed by GitHub
parent e09c606649
commit 53dbf1ca34
4 changed files with 97 additions and 24 deletions

View File

@@ -32,7 +32,7 @@ export interface CurrentWeatherFeedItem extends FeedItem<
CurrentWeatherData
> {}
export type HourlyWeatherData = {
export type HourlyWeatherEntry = {
forecastTime: Date
conditionCode: ConditionCode
daylight: boolean
@@ -48,6 +48,10 @@ export type HourlyWeatherData = {
windSpeed: number
}
export type HourlyWeatherData = {
hours: HourlyWeatherEntry[]
}
export interface HourlyWeatherFeedItem extends FeedItem<
typeof WeatherFeedItemType.Hourly,
HourlyWeatherData