Ignore invalid temp
This commit is contained in:
parent
ce0ef7d291
commit
3d3492a283
@ -15,13 +15,19 @@ func (u *WeatherUpdate) Enrich(weatherStations ...*config.WeatherStation) {
|
|||||||
return
|
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 {
|
if u.BaromAbsoluteIn != nil && *u.BaromAbsoluteIn < 20 {
|
||||||
u.BaromAbsoluteIn = nil
|
u.BaromAbsoluteIn = nil
|
||||||
}
|
}
|
||||||
if u.BaromRelativeIn != nil && *u.BaromRelativeIn < 20 {
|
if u.BaromRelativeIn != nil && *u.BaromRelativeIn < 20 {
|
||||||
u.BaromRelativeIn = nil
|
u.BaromRelativeIn = nil
|
||||||
}
|
}
|
||||||
|
if u.TempIndoorF != nil && *u.TempIndoorF < -1000 {
|
||||||
|
u.TempIndoorF = nil
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate Wind Chill
|
// Calculate Wind Chill
|
||||||
if u.WindChillF == nil && u.TempOutdoorF != nil && u.WindSpeedMPH != nil {
|
if u.WindChillF == nil && u.TempOutdoorF != nil && u.WindSpeedMPH != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user