Updated model and normalizers to map provider “feels like” fields into a single ApparentTemperatureC field.

This commit is contained in:
2026-01-17 10:36:19 -06:00
parent c12cf91115
commit b4a67e208c
8 changed files with 33 additions and 14 deletions

View File

@@ -25,7 +25,7 @@ import (
// Event.EmittedAt when present, otherwise the first hourly time.
// - Hourly payloads are array-oriented; missing fields are treated as nil per-period.
// - Snowfall is provided in centimeters and is converted to millimeters.
// - apparent_temperature is ignored (no canonical "feels like" field).
// - apparent_temperature is mapped to ApparentTemperatureC when present.
type ForecastNormalizer struct{}
func (ForecastNormalizer) Match(e event.Event) bool {
@@ -121,6 +121,9 @@ func buildForecast(parsed omForecastResponse, fallbackIssued time.Time) (model.W
if v := floatAt(parsed.Hourly.Temperature2m, i); v != nil {
period.TemperatureC = v
}
if v := floatAt(parsed.Hourly.ApparentTemp, i); v != nil {
period.ApparentTemperatureC = v
}
if v := floatAt(parsed.Hourly.DewPoint2m, i); v != nil {
period.DewpointC = v
}