diff --git a/homeassistant/components/delijn/sensor.py b/homeassistant/components/delijn/sensor.py index e04385dcf3d..ee58a4f21c7 100644 --- a/homeassistant/components/delijn/sensor.py +++ b/homeassistant/components/delijn/sensor.py @@ -1,6 +1,7 @@ """Support for De Lijn (Flemish public transport) information.""" from __future__ import annotations +from datetime import datetime import logging from pydelijn.api import Passages @@ -111,7 +112,9 @@ class DeLijnPublicTransportSensor(SensorEntity): first = self.line.passages[0] if (first_passage := first["due_at_realtime"]) is None: first_passage = first["due_at_schedule"] - self._attr_native_value = first_passage + self._attr_native_value = datetime.strptime( + first_passage, "%Y-%m-%dT%H:%M:%S%z" + ) for key in AUTO_ATTRIBUTES: self._attr_extra_state_attributes[key] = first[key]