Updated the normalized observation schema to remove duplicate and/or unnecessary fields
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
@@ -86,20 +86,9 @@ func buildObservation(parsed omResponse) (model.WeatherObservation, time.Time, e
|
||||
StationName: "Open-Meteo",
|
||||
Timestamp: ts,
|
||||
|
||||
ConditionCode: wmo,
|
||||
ConditionText: canonicalText,
|
||||
IsDay: isDay,
|
||||
|
||||
// Open-Meteo does not provide a separate human text description for "current"
|
||||
// when using weather_code; we leave provider evidence empty.
|
||||
ProviderRawDescription: "",
|
||||
|
||||
// Transitional / human-facing:
|
||||
// keep output consistent by populating TextDescription from canonical text.
|
||||
ConditionCode: wmo,
|
||||
IsDay: isDay,
|
||||
TextDescription: canonicalText,
|
||||
|
||||
// IconURL: Open-Meteo does not provide an icon URL in this endpoint.
|
||||
IconURL: "",
|
||||
}
|
||||
|
||||
// Measurements (all optional; only set when present).
|
||||
@@ -132,20 +121,13 @@ func buildObservation(parsed omResponse) (model.WeatherObservation, time.Time, e
|
||||
obs.WindGustKmh = &v
|
||||
}
|
||||
|
||||
if parsed.Current.SurfacePressure != nil {
|
||||
if parsed.Current.PressureMSL != nil {
|
||||
v := normcommon.PressurePaFromHPa(*parsed.Current.PressureMSL)
|
||||
obs.BarometricPressurePa = &v
|
||||
} else if parsed.Current.SurfacePressure != nil {
|
||||
v := normcommon.PressurePaFromHPa(*parsed.Current.SurfacePressure)
|
||||
obs.BarometricPressurePa = &v
|
||||
}
|
||||
|
||||
if parsed.Current.PressureMSL != nil {
|
||||
v := normcommon.PressurePaFromHPa(*parsed.Current.PressureMSL)
|
||||
obs.SeaLevelPressurePa = &v
|
||||
}
|
||||
|
||||
if parsed.Elevation != nil {
|
||||
v := *parsed.Elevation
|
||||
obs.ElevationMeters = &v
|
||||
}
|
||||
|
||||
return obs, ts, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user