From 3d3492a28347291e1d843bc446a48a8c51985e01 Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Tue, 28 Jan 2025 19:41:57 -0500 Subject: [PATCH] Ignore invalid temp --- pkg/weather/enrich.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 {