@@ -144,6 +144,10 @@ func processDailyForecast(ctx context.Context, lat, lon float64, units string) a
144144 if uvIndex == nil {
145145 uvIndex = dayParts .UvIndex [i * 2 + 1 ]
146146 }
147+ windSpeed := dayParts .WindSpeed [i * 2 ]
148+ if windSpeed == nil {
149+ windSpeed = dayParts .WindSpeed [i * 2 + 1 ]
150+ }
147151 response [day ] = map [string ]any {
148152 "high" : forecast .CalendarDayTemperatureMax [i ],
149153 "low" : forecast .CalendarDayTemperatureMin [i ],
@@ -153,12 +157,14 @@ func processDailyForecast(ctx context.Context, lat, lon float64, units string) a
153157 //"moonrise": forecast.MoonriseTimeLocal[i],
154158 //"moonset": forecast.MoonsetTimeLocal[i],
155159 //"moon_phase": forecast.MoonPhase[i],
156- "qpf" : forecast .Qpf [i ],
157- "qpf_snow" : forecast .QpfSnow [i ],
158- "uv_index" : uvIndex ,
160+ "qpf" : forecast .Qpf [i ],
161+ "qpf_snow" : forecast .QpfSnow [i ],
162+ "uv_index" : uvIndex ,
163+ "wind_speed" : windSpeed ,
159164 }
160165 }
161166 response ["temperatureUnit" ] = forecast .TemperatureUnit
167+ response ["windSpeedUnit" ] = forecast .WindSpeedUnit
162168 response ["attribution" ] = "The Weather Channel"
163169 return response
164170}
@@ -180,6 +186,7 @@ func processHourlyForecast(ctx context.Context, lat, lon float64, units string)
180186 "temperature" : hourly .Temperature [i ],
181187 "uv_index" : hourly .UVIndex [i ],
182188 "description" : hourly .WxPhraseLong [i ],
189+ "wind_speed" : hourly .WindSpeed [i ],
183190 }
184191 if hourly .PrecipChance [i ] > 20 {
185192 entry ["precip_chance" ] = fmt .Sprintf ("%d%%" , hourly .PrecipChance [i ])
0 commit comments