mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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.
This commit is contained in:
parent
60c5ef5b34
commit
6b5cd74771
@ -165,9 +165,9 @@ class GarminConnectSensor(Entity):
|
|||||||
return
|
return
|
||||||
|
|
||||||
data = self._data.data
|
data = self._data.data
|
||||||
if "Duration" in self._type:
|
if "Duration" in self._type and data[self._type]:
|
||||||
self._state = data[self._type] // 60
|
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
|
self._state = data[self._type] // 60
|
||||||
else:
|
else:
|
||||||
self._state = data[self._type]
|
self._state = data[self._type]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user