From a5022011edb43fa8fc034d417a47a1cffe48ed56 Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 6 Oct 2022 13:04:27 +0200 Subject: [PATCH] Removed unused imports and fixed real_time_mode --- pyrmv/methods/journey_detail.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pyrmv/methods/journey_detail.py b/pyrmv/methods/journey_detail.py index de1d6f8..0b381c7 100644 --- a/pyrmv/methods/journey_detail.py +++ b/pyrmv/methods/journey_detail.py @@ -1,7 +1,6 @@ from datetime import datetime from typing import Union from pyrmv.classes.Journey import Journey -from pyrmv.errors.not_ready import NotReadyYetError from pyrmv.enums.rt_mode import RealTimeMode from pyrmv.raw.journey_detail import journey_detail as raw_journey_detail from pyrmv.utility.find_exception import find_exception @@ -23,7 +22,7 @@ def journey_detail( to_index: int = None # type: ignore ) -> Journey: """The journey_detail method will deliver information about the complete route of a vehicle. The journey - identifier is part of a trip or `board_departure` response. It contains a list of all stops/stations of this journey + identifier is part of a trip or `board_departure()` response. It contains a list of all stops/stations of this journey including all departure and arrival times (with real-time data if available) and additional information like specific attributes about facilities and other texts. @@ -43,11 +42,16 @@ def journey_detail( * Journey: Instance of Journey object. """ + if real_time_mode == None: + real_time_mode = None + else: + real_time_mode = real_time_mode.code + journey_raw = raw_journey_detail( accessId=access_id, id=id, date=date, - rtMode=real_time_mode.code, + rtMode=real_time_mode, fromId=from_id, fromIdx=from_index, toId=to_id,