Charging session
State
Public charging points
Declaration
getPublicChargingPoints()
Discussion
Matching public charging points.
Example
val state:ChargingSession.State
assertTrue(state.publicChargingPoints[0].value?.city == "Berlin")
assertTrue(state.publicChargingPoints[0].value?.postalCode == "10997")
assertTrue(state.publicChargingPoints[0].value?.street == "Skalitzer Straße 68")
assertTrue(state.publicChargingPoints[0].value?.provider == "High Energy Low Prices Charging Provider")
// Matching public charging point from 'High Energy Low Prices Charging Provider' is located at Skalitzer Straße 60, 10997 Berlin
Displayed state of charge
Declaration
getDisplayedStateOfCharge()
Discussion
Displayed state of charge to the driver
Example
val state:ChargingSession.State
assertTrue(state.displayedStateOfCharge.value == 0.29)
// Displayed state of charge is 29.0%
Displayed start state of charge
Declaration
getDisplayedStartStateOfCharge()
Discussion
Displayed state of charge at start to the driver
Example
val state:ChargingSession.State
assertTrue(state.displayedStartStateOfCharge.value == 0.12)
// Displayed start state of charge is 12.0%
Business errors
Declaration
getBusinessErrors()
Example
val state:ChargingSession.State
assertTrue(state.businessErrors[0].value == "Please check the charging station")
// Business error states 'Please check the charging station'
Time zone
Declaration
getTimeZone()
Discussion
Time zone of the charging session
Example
val state:ChargingSession.State
assertTrue(state.timeZone.value == "Europe/Berlin")
// Charging session`s time zone is Europe - Berlin
Start time
Declaration
getStartTime()
Discussion
Start time of the charging session
Example
val state:ChargingSession.State
assertTrue(dateIsSame(state.startTime.value, "2021-03-10T11:00:39.373Z"))
// Charging session started on 10. March 2021 at 10:57:57 CET
End time
Declaration
getEndTime()
Discussion
End time of the charging session
Example
val state:ChargingSession.State
assertTrue(dateIsSame(state.endTime.value, "2021-03-10T10:58:45.694Z"))
// Charging session ended on 10. March 2021 at 10:58:45 CET
Total charging duration
Declaration
getTotalChargingDuration()
Discussion
Total time charging was active during the session
Example
val state:ChargingSession.State
assertTrue(state.totalChargingDuration.value?.value == 8765.0)
assertTrue(state.totalChargingDuration.value?.unit == Duration.Unit.SECONDS)
// Total time the charging was active was 8765.0s in the session
Calculated energy charged
Declaration
getCalculatedEnergyCharged()
Discussion
Calculated amount of energy charged during the session
Example
val state:ChargingSession.State
assertTrue(state.calculatedEnergyCharged.value?.value == 3.567)
assertTrue(state.calculatedEnergyCharged.value?.unit == Energy.Unit.KILOWATT_HOURS)
// Calculated amount of energy charged was 3.567Kwh during the session
Energy charged
Declaration
getEnergyCharged()
Discussion
Energy charged during the session
Example
val state:ChargingSession.State
assertTrue(state.energyCharged.value?.value == 2.345)
assertTrue(state.energyCharged.value?.unit == Energy.Unit.KILOWATT_HOURS)
// Energy charged in the last session was 2.345Kwh
Preconditioning state
Declaration
getPreconditioningState()
Discussion
Preconditioning is active or not
Example
val state:ChargingSession.State
assertTrue(state.preconditioningState.value == ActiveState.ACTIVE)
// Preconditioning is active
Odometer
Declaration
getOdometer()
Discussion
The vehicle odometer value in a given units
Example
val state:ChargingSession.State
assertTrue(state.odometer.value?.value == 2050.0)
assertTrue(state.odometer.value?.unit == Length.Unit.KILOMETERS)
// Odometer is showing 2050.0km
Charging cost
Declaration
getChargingCost()
Discussion
Charging cost information
Example
val state:ChargingSession.State
assertTrue(state.chargingCost.value?.currency == "EUR")
assertTrue(state.chargingCost.value?.calculatedChargingCost == 2.2758383109)
assertTrue(state.chargingCost.value?.calculatedSavings == 0.5672)
assertTrue(state.chargingCost.value?.simulatedImmediateChargingCost == 2.2758383109)
// Charging costs are shown in 'EUR' with calculated costs of 2.2758383109, calculated savings 0.5672 and simulated charging cost of 2.2758383109
Location
Declaration
getLocation()
Discussion
Charging location address
Example
val state:ChargingSession.State
assertTrue(state.location.value?.municipality == "Berlin")
assertTrue(state.location.value?.formattedAddress == "Skalitzer Straße 68, 10997 Berlin, Germany")
assertTrue(state.location.value?.streetAddress == "Skalitzer Straße 68")
// Charging location was 'Skalitzer Straße 68, 10997 Berlin, Germany'