Only normalise Garmin connect data to minutes if the value is not None (#31526)
Otherwise this causes additional TypeError messages to be logged for division of None.pull/31547/head
parent
7233048fea
commit
24c382d689
|
@ -165,9 +165,9 @@ class GarminConnectSensor(Entity):
|
|||
return
|
||||
|
||||
data = self._data.data
|
||||
if "Duration" in self._type:
|
||||
if "Duration" in self._type and data[self._type]:
|
||||
self._state = data[self._type] // 60
|
||||
elif "Seconds" in self._type:
|
||||
elif "Seconds" in self._type and data[self._type]:
|
||||
self._state = data[self._type] // 60
|
||||
else:
|
||||
self._state = data[self._type]
|
||||
|
|
Loading…
Reference in New Issue