mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +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
|
||||
|
||||
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…
x
Reference in New Issue
Block a user