updateVehicleProperties

abstract fun updateVehicleProperties(vehicleProperties: List<VehicleProperty>)

Updates the properties of the vehicle. The only properties that can be updated are those defined by the currently set vehicle.

Example snippet that updates the current charge of the electric vehicle's engine to 42kWh:

val updatedElectricEngineProperties = ElectricEngineProperties(
listOf(
CurrentChargeProperty(42.kilowattHours)
)
)
vehicleProvider.updateVehicleProperties(listOf(updatedElectricEngineProperties))

Return

An empty list. The list type allows future releases to extend the contract without breaking callers.

Throws

When attempting to update properties of a feature that the Vehicle does not support, e.g.:

  • electric or combustion engine properties on a Vehicle without the respective engine,

  • Motorized/CargoCapable interface properties on a non-motorized/non-cargo-capable Vehicle,

  • busType on non-bus Vehicle.