prefer total_seconds over seconds (#49505)
This commit is contained in:
parent
020d456889
commit
a90d3a051f
31 changed files with 65 additions and 46 deletions
|
@ -527,7 +527,7 @@ class GTFSDepartureSensor(SensorEntity):
|
|||
name: Any | None,
|
||||
origin: Any,
|
||||
destination: Any,
|
||||
offset: cv.time_period,
|
||||
offset: datetime.timedelta,
|
||||
include_tomorrow: bool,
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
|
@ -699,7 +699,7 @@ class GTFSDepartureSensor(SensorEntity):
|
|||
del self._attributes[ATTR_LAST]
|
||||
|
||||
# Add contextual information
|
||||
self._attributes[ATTR_OFFSET] = self._offset.seconds / 60
|
||||
self._attributes[ATTR_OFFSET] = self._offset.total_seconds() / 60
|
||||
|
||||
if self._state is None:
|
||||
self._attributes[ATTR_INFO] = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue