Small enum fixes

This commit is contained in:
Profitroll 2022-10-04 14:40:27 +02:00
parent 83af5b33da
commit 0719eaacbc
3 changed files with 19 additions and 4 deletions

View File

@ -42,6 +42,11 @@ def stop_by_coords(
* dict: Output from RMV. Dict will contain "errorCode" and "errorText" if exception occurs.
"""
if selection_mode == None:
selection_mode = None
else:
selection_mode = (selection_mode.code).upper()
stops = []
stops_raw = raw_stop_by_coords(
accessId=access_id,
@ -51,7 +56,7 @@ def stop_by_coords(
radius=radius,
maxNo=max_number,
stopType=(stop_type.code).upper(),
locationSelectionMode=(selection_mode.code).upper()
locationSelectionMode=selection_mode
)
find_exception(stops_raw)

View File

@ -52,6 +52,11 @@ def stop_by_name(
* dict: Output from RMV. Dict will contain "errorCode" and "errorText" if exception occurs.
"""
if selection_mode == None:
selection_mode = None
else:
selection_mode = (selection_mode.code).upper()
stops = []
stops_raw = raw_stop_by_name(
accessId=access_id,
@ -59,13 +64,13 @@ def stop_by_name(
lang=lang.code,
maxNo=max_number,
stopType=(stop_type.code).upper(),
locationSelectionMode=(selection_mode.code).upper(),
locationSelectionMode=selection_mode,
coordLat=coord_lat,
coordLong=coord_lon,
radius=radius,
refineId=refine_id,
stations=stations,
filterMode=filter_mode.code
filterMode=(filter_mode.code).upper()
)
find_exception(stops_raw)

View File

@ -128,6 +128,11 @@ def trip_find(
* List[Trip]: List of Trip objects. Empty list if none found.
"""
if real_time_mode == None:
real_time_mode = None
else:
real_time_mode = (real_time_mode.code).upper()
trips = []
trips_raw = raw_trip_find(
@ -183,7 +188,7 @@ def trip_find(
showPassingPoints=passing_points,
rtMode=(real_time_mode.code).upper(),
rtMode=real_time_mode,
includeEarlier=include_earlier,
withICTAlternatives=ict_alternatives,