Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions homeassistant/components/gtfs/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def __init__(
self._available = False
self._icon = ICON
self._name = ""
self._state: str | None = None
self._state: datetime.datetime | None = None
self._attributes: dict[str, Any] = {}

self._agency = None
Expand All @@ -563,7 +563,7 @@ def name(self) -> str:
return self._name

@property
def native_value(self) -> str | None:
def native_value(self) -> datetime.datetime | None:
"""Return the state of the sensor."""
return self._state

Expand Down Expand Up @@ -619,9 +619,7 @@ def update(self) -> None:
if not self._departure:
self._state = None
else:
self._state = dt_util.as_utc(
self._departure["departure_time"]
).isoformat()
self._state = dt_util.as_utc(self._departure["departure_time"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UTC conversion is no longer needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Fetch trip and route details once, unless updated
if not self._departure:
Expand Down