prefer total_seconds over seconds (#49505)

This commit is contained in:
Paulus Schoutsen 2021-04-20 17:41:36 -07:00 committed by GitHub
parent 020d456889
commit a90d3a051f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 65 additions and 46 deletions

View file

@ -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] = (