Contents

ElectricVehicleStatusEvent.Status.chargingActive(_:)

A status that indicates that the vehicle is actively charging.

Declaration

case chargingActive(ElectricVehicleChargingReason.ActiveReason)

Mentioned in

Discussion

When your app provides status for a load event, communicate charging activity using this method. The ElectricVehicleChargingReason.ActiveReason arguments you provide explain why charging starts, such as when cleaner grid conditions or lower rates become available. For example:

let activeEvent = ElectricVehicleStatusEvent(
    timestamp: Date.now,
    device: device,
    venueID: venueID,
    status: .chargingActive(.cleanerEnergyAvailable),
    stateOfCharge: 43,
    energy: Measurement(value: 25_000_000, unit: .EnergyKit.milliwattHours),
    estimatedRange: Measurement(value: 120, unit: .miles),
    chargingTarget: chargingTarget,
    sessionIdentifier: session.id
)

If your app adopts the EnergyKit LoadEvents Entitlement, include the load event’s session identifier to correlate the active status with energy consumption data for a specific charging session in the Home app.

See Also

Charging states