entur / lamassu

Mobility hub
European Union Public License 1.2
5 stars 7 forks source link

Vehicles with propulsion type human should not state current_range_meters=0 #502

Closed hbruch closed 1 month ago

hbruch commented 1 month ago

Expected behavior

Vehicles with a vehicle_type that has propulsion_type=human should not state current_range_meters=0

Observed behavior

Both VehicleStatusFeedMappers(v2.3 and v3.0) set a missing current_range_meters to 0 without regard to the vehicle's propulsion_type.

Version of lamassu used (exact commit hash or JAR name)

e8abc84f7b24ea9b941db277214c84ac4fab6aae

testower commented 1 month ago

Good catch!

hbruch commented 1 month ago

Do you have a preference how to fix this? Personally, I just would not set the range to 0 if it is not given, as the feed provider is responsible for feed correctness. This is usually the approach lamassu takes.

Otherwise, the VehicleStatusMappers would not only require access to the vehicle status feed itself, but also to the vehicle types feed.

testower commented 1 month ago

I agree with your solution 👍