Added support for "StopLocation", "CoordLocation"

This commit is contained in:
Profitroll 2022-09-24 11:41:08 +02:00
parent 660c9644f9
commit 8bf1a6fee3
2 changed files with 8 additions and 2 deletions

View File

@ -75,5 +75,8 @@ def stop_by_coords(accessId: str,
else:
stops = []
for stop in output.json()["stopLocationOrCoordLocation"]:
stops.append(Stop(stop["StopLocation"]))
if "StopLocation" in stop:
stops.append(Stop(stop["StopLocation"]))
elif "CoordLocation" in stop:
stops.append(Stop(stop["CoordLocation"]))
return stops

View File

@ -89,5 +89,8 @@ def stop_by_name(accessId: str,
else:
stops = []
for stop in output.json()["stopLocationOrCoordLocation"]:
stops.append(Stop(stop["StopLocation"]))
if "StopLocation" in stop:
stops.append(Stop(stop["StopLocation"]))
elif "CoordLocation" in stop:
stops.append(Stop(stop["CoordLocation"]))
return stops