Updated model and normalizers to map provider “feels like” fields into a single ApparentTemperatureC field.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user