Skip to content

Commit

Permalink
correctly check for station instance
Browse files Browse the repository at this point in the history
  • Loading branch information
zaanposni committed May 20, 2024
1 parent 3b992e6 commit b2b1cf1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vvspy/arrivals.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_arrivals(
"type_dm": kwargs.get("type_dm", "any"),
"anyObjFilter_dm": kwargs.get("anyObjFilter_dm", 2),
"deleteAssignedStops": kwargs.get("deleteAssignedStops", 1),
"name_dm": station_id.value if type(station_id) == "<enum 'Station'>" else str(station_id),
"name_dm": station_id.value if isinstance(station_id, Station) else str(station_id),
"mode": kwargs.get("mode", "direct"),
"dmLineSelectionAll": kwargs.get("dmLineSelectionAll", 1),
"useRealtime": kwargs.get("useRealtime", 1), # live delay
Expand Down
2 changes: 1 addition & 1 deletion vvspy/departures.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_departures(
"type_dm": kwargs.get("type_dm", "any"),
"anyObjFilter_dm": kwargs.get("anyObjFilter_dm", 2),
"deleteAssignedStops": kwargs.get("deleteAssignedStops", 1),
"name_dm": station_id.value if type(station_id) == "<enum 'Station'>" else str(station_id),
"name_dm": station_id.value if isinstance(station_id, Station) else str(station_id),
"mode": kwargs.get("mode", "direct"),
"dmLineSelectionAll": kwargs.get("dmLineSelectionAll", 1),
"useRealtime": kwargs.get("useRealtime", 1), # live delay
Expand Down
4 changes: 2 additions & 2 deletions vvspy/trip.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def get_trips(
"language": kwargs.get("language", "de"),
"locationServerActive": kwargs.get("locationServerActive", "1"),
"macroWebTrip": kwargs.get("macroWebTrip", "true"),
"name_destination": destination_station_id.value if type(destination_station_id) == "<enum 'Station'>" else str(destination_station_id),
"name_origin": origin_station_id.value if type(origin_station_id) == "<enum 'Station'>" else str(origin_station_id),
"name_destination": destination_station_id.value if isinstance(destination_station_id, Station) else str(destination_station_id),
"name_origin": origin_station_id.value if isinstance(origin_station_id, Station) else str(origin_station_id),
"noElevationProfile": kwargs.get("noElevationProfile", "1"),
"noElevationSummary": kwargs.get("noElevationSummary", "1"),
"outputFormat": "rapidJSON",
Expand Down

0 comments on commit b2b1cf1

Please sign in to comment.