Skip to content

Commit c02ff9a

Browse files
committed
simply added "free_bike_status" to the FEATURE_ENDPOINTS list
1 parent 32b251e commit c02ff9a

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

functions-python/gbfs_validator/src/gbfs_data_processor.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"vehicle_types",
3737
"station_status",
3838
"vehicle_status",
39+
"free_bike_status",
3940
"system_regions",
4041
"system_pricing_plans",
4142
"system_alerts",
@@ -308,30 +309,10 @@ def update_or_create_gbfs_endpoint(
308309
gbfs_endpoint_orm = Gbfsendpoint(
309310
id=formatted_id, name=endpoint.name, language=endpoint.language
310311
)
311-
312312
gbfs_endpoint_orm.url = endpoint.url
313-
314-
# Handle the vehicle status endpoints based on GBFS version
315-
is_vehicle_status = False
316-
if version.startswith("3."):
317-
is_vehicle_status = True
318-
else:
319-
is_vehicle_status = False # For versions below v3.0, free_bike_status is equivalent to vehicle_status
320-
321-
if is_vehicle_status:
322-
gbfs_endpoint_orm.is_feature = (
323-
endpoint.name in features and endpoint.name in FEATURE_ENDPOINTS
324-
)
325-
else:
326-
old_version_features = FEATURE_ENDPOINTS.copy()
327-
# For older versions, replace vehicle_status with free_bike_status
328-
old_version_features = [
329-
"free_bike_status" if feature == "vehicle_status" else feature
330-
for feature in FEATURE_ENDPOINTS
331-
]
332-
gbfs_endpoint_orm.is_feature = (
333-
endpoint.name in features and endpoint.name in old_version_features
334-
)
313+
gbfs_endpoint_orm.is_feature = (
314+
endpoint.name in features and endpoint.name in FEATURE_ENDPOINTS
315+
)
335316
return gbfs_endpoint_orm
336317

337318
def validate_gbfs_feed_versions(self) -> None:

0 commit comments

Comments
 (0)