Made forecast-period conditionCode optional
All checks were successful
ci/woodpecker/manual/build-image Pipeline was successful
All checks were successful
ci/woodpecker/manual/build-image Pipeline was successful
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user