updateVehicle

open override fun updateVehicle(updatedProperties: List<VehicleProperty>)

Updates the properties of the vehicle. Only properties that were defined by the vehicle previously set via setVehicle can be updated.

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

val updatedElectricEngineProperties = ElectricEngineProperties(
listOf(
CurrentChargeProperty(Energy.kilowattHours(42))
)
)
updateVehicle(listOf(updatedElectricEngineProperties))

Important: This is a Public Preview API. It may be changed or removed at any time.

Parameters

updatedProperties

List of updated vehicle properties.

Throws

When trying to update a vehicle property that was not defined by the vehicle previously set via setVehicle, or if the vehicle would be in inconsistent state after the update.