From 4378f4ec78c2bf3d9dd7e2f035f3642dcced9228 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 12 Jun 2022 13:47:19 +0200 Subject: [PATCH] Audi: fix outside temperature --- vehicle/vw/types.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vehicle/vw/types.go b/vehicle/vw/types.go index a141cf94f..7abc6ff9f 100644 --- a/vehicle/vw/types.go +++ b/vehicle/vw/types.go @@ -147,5 +147,9 @@ func (t *TimedTemperature) UnmarshalJSON(data []byte) error { // temp2Float converts api temp to float value func temp2Float(i int) float64 { - return float64(i)/10 - 273 + f := float64(i) + if f == 0 { + return math.NaN() + } + return f/10 - 273 }