Made forecast-period conditionCode optional
All checks were successful
ci/woodpecker/manual/build-image Pipeline was successful

This commit is contained in:
2026-05-28 07:47:07 -05:00
parent f457bab039
commit cca873cafb
10 changed files with 54 additions and 19 deletions

View File

@@ -98,6 +98,7 @@ func buildForecast(parsed omForecastResponse, fallbackIssued time.Time) (model.W
}
wmo := wmoAt(parsed.Hourly.WeatherCode, i)
wmoPtr := wmoCodePtr(wmo)
canonicalText := standards.WMOText(wmo, isDay)
period := model.WeatherForecastPeriod{
@@ -107,7 +108,7 @@ func buildForecast(parsed omForecastResponse, fallbackIssued time.Time) (model.W
Name: "",
IsDay: isDay,
ConditionCode: wmo,
ConditionCode: wmoPtr,
TextDescription: canonicalText,
}
@@ -237,3 +238,8 @@ func wmoAt(vals []*int, idx int) model.WMOCode {
}
return model.WMOUnknown
}
func wmoCodePtr(code model.WMOCode) *model.WMOCode {
out := code
return &out
}