Compare commits
2 Commits
96dfcf7e53
...
2e3cfb44f4
Author | SHA1 | Date | |
---|---|---|---|
2e3cfb44f4 | |||
be8a4f3bca |
@ -85,6 +85,7 @@ func (aw *AmbientWeather) handleProviderRequest(
|
||||
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
// Calculate any fields that may be missing
|
||||
|
@ -5,6 +5,10 @@ import "math"
|
||||
// Attempts to complete missing fields that may not
|
||||
// be set by a specific provider, such as DewPoint and WindChill
|
||||
func (u *WeatherUpdate) Enrich() {
|
||||
if u == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if u.WindChillF == 0 {
|
||||
u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user