diff --git a/pkg/weather/enrich.go b/pkg/weather/enrich.go index dff72a4..ce8feff 100644 --- a/pkg/weather/enrich.go +++ b/pkg/weather/enrich.go @@ -15,13 +15,19 @@ func (u *WeatherUpdate) Enrich(weatherStations ...*config.WeatherStation) { return } - // Clear invalid measurements + // Clear invalid measurements, would be better if these weren't + // sent when sensor was out of range. + // TODO: This should probably just be done for all fields where + // the value is -9999 if u.BaromAbsoluteIn != nil && *u.BaromAbsoluteIn < 20 { u.BaromAbsoluteIn = nil } if u.BaromRelativeIn != nil && *u.BaromRelativeIn < 20 { u.BaromRelativeIn = nil } + if u.TempIndoorF != nil && *u.TempIndoorF < -1000 { + u.TempIndoorF = nil + } // Calculate Wind Chill if u.WindChillF == nil && u.TempOutdoorF != nil && u.WindSpeedMPH != nil {