From d32d0ee8d7af34f9814af7524569ed6829dd2c75 Mon Sep 17 00:00:00 2001 From: Andrey Shpilevoy Date: Sat, 20 Jun 2020 23:17:03 +0200 Subject: [PATCH] Update sensor.py --- custom_components/ovapi/sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/ovapi/sensor.py b/custom_components/ovapi/sensor.py index 4ad634d..b777b76 100644 --- a/custom_components/ovapi/sensor.py +++ b/custom_components/ovapi/sensor.py @@ -233,6 +233,7 @@ def update(self): stop['DestinationName50'], "stop_name": stop['TimingPointName'], "TargetDepartureTime": target_departure_time.time(), + "TargetDepartureDateTime": target_departure_time, "ExpectedArrivalTime": expected_arrival_time.time(), "Delay": delay } @@ -251,7 +252,7 @@ def update(self): self._departures = STATE_UNKNOWN self._state = STATE_UNKNOWN else: - stops_list.sort(key=operator.itemgetter('TargetDepartureTime')) + stops_list.sort(key=operator.itemgetter('TargetDepartureDateTime')) self._destination = stops_list[self._sensor_number]["destination"] self._provider = stops_list[self._sensor_number]["provider"]