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

@@ -68,6 +68,11 @@ func buildObservation(parsed owmResponse) (model.WeatherObservation, time.Time,
// - wind speed is m/s -> km/h conversion
tempC := parsed.Main.Temp
rh := parsed.Main.Humidity
var apparentC *float64
if parsed.Main.FeelsLike != nil {
v := *parsed.Main.FeelsLike
apparentC = &v
}
surfacePa := normcommon.PressurePaFromHPa(parsed.Main.Pressure)
var seaLevelPa *float64
@@ -117,6 +122,7 @@ func buildObservation(parsed owmResponse) (model.WeatherObservation, time.Time,
IconURL: iconURL,
TemperatureC: &tempC,
ApparentTemperatureC: apparentC,
WindDirectionDegrees: parsed.Wind.Deg,
WindSpeedKmh: &wsKmh,

View File

@@ -15,10 +15,11 @@ type owmResponse struct {
Weather []owmWeather `json:"weather"`
Main struct {
Temp float64 `json:"temp"` // °C when units=metric (enforced by source)
Pressure float64 `json:"pressure"` // hPa
Humidity float64 `json:"humidity"` // %
SeaLevel *float64 `json:"sea_level"`
Temp float64 `json:"temp"` // °C when units=metric (enforced by source)
FeelsLike *float64 `json:"feels_like"` // °C when units=metric (enforced by source)
Pressure float64 `json:"pressure"` // hPa
Humidity float64 `json:"humidity"` // %
SeaLevel *float64 `json:"sea_level"`
} `json:"main"`
Visibility *float64 `json:"visibility"` // meters (optional)