Fix NaN with zero values
All checks were successful
Build and Publish / release (push) Successful in 3m7s

This commit is contained in:
Ryan McGuire 2025-01-05 19:05:24 -05:00
parent 2ed4eca56c
commit c002331fd4

View File

@ -13,7 +13,7 @@ func (u *WeatherUpdate) Enrich() {
u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH) u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH)
} }
if u.DewPointF == 0 { if u.DewPointF == 0 && (u.TempOutdoorF != 0 && u.HumidityOudoor != 0) {
u.DewPointF = CalculateDewPoint(u.TempOutdoorF, float64(u.HumidityOudoor)) u.DewPointF = CalculateDewPoint(u.TempOutdoorF, float64(u.HumidityOudoor))
} }