Skip to content

Commit

Permalink
Merge pull request #26 from AndreyShpilevoy/master
Browse files Browse the repository at this point in the history
Update sensor.py to sort correctly
  • Loading branch information
Paul-dH authored Jun 25, 2020
2 parents 38057bd + d32d0ee commit cd9a78c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/ovapi/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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"]
Expand Down

0 comments on commit cd9a78c

Please sign in to comment.