One Logo Pool Ball
EnergyKit · IOS API REFERENCE

ElectricVehicleLoadEvent.ElectricalMeasurement

struct · iOS 26.0+ · SDK 27.1

struct ElectricalMeasurement

A description of the electricity consumed or generated by a device.

Members (7)

init · iOS 27.0+

init

TypeScript
static initStateOfChargeDirectionPowerEnergyPerformanceMetrics(stateOfCharge: number, direction: ElectricityFlowDirection, power: _Foundation_Measurement<_Foundation_UnitPower>, energy: _Foundation_Measurement<_Foundation_UnitEnergy>, performanceMetrics?: (ElectricVehicleLoadEvent_ElectricalMeasurement_PerformanceMetrics) | null): ElectricVehicleLoadEvent_ElectricalMeasurement
Swift declaration
init(stateOfCharge: Int, direction: ElectricityFlowDirection, power: Measurement<UnitPower>, energy: Measurement<UnitEnergy>, performanceMetrics: ElectricVehicleLoadEvent.ElectricalMeasurement.PerformanceMetrics?)

Creates an electrical measurement with optional performance metrics.

init · iOS 26.0+ · Deprecated in iOS 27.0

init

TypeScript
static initStateOfChargeDirectionPowerEnergy(stateOfCharge: number, direction: ElectricityFlowDirection, power: _Foundation_Measurement<_Foundation_UnitPower>, energy: _Foundation_Measurement<_Foundation_UnitEnergy>): ElectricVehicleLoadEvent_ElectricalMeasurement
Swift declaration
init(stateOfCharge: Int, direction: ElectricityFlowDirection, power: Measurement<UnitPower>, energy: Measurement<UnitEnergy>)

Initializes an electrical measurement for the electrical load event. - Parameters: - stateOfCharge: The remaining capacity available in a battery - direction: Specifies whether electricity is being imported from the grid or exported to the grid. - power: Power in milli-watts - energy: The accumulated electrical energy consumed or generated by the device in milli-watt hours. The accumulator is reset on ``ElectricalLoadEvent/Session/State/end``.

get · iOS 26.0+

stateOfCharge

TypeScript
get stateOfCharge(): number
Swift declaration
let stateOfCharge: Int

The remaining capacity available in a battery An integer ranging from `0` to `100` that's proportional to the percentage of remaining capacity available in the battery where `0` and `100` correspond to the min and max state of charge respectively. - `0`: empty - `100`: full.

get · iOS 27.0+

performanceMetrics

TypeScript
get performanceMetrics(): (ElectricVehicleLoadEvent_ElectricalMeasurement_PerformanceMetrics) | null
Swift declaration
var performanceMetrics: ElectricVehicleLoadEvent.ElectricalMeasurement.PerformanceMetrics? { get }

Performance metrics for this measurement, or `nil` if unavailable.

get · iOS 26.0+

power

TypeScript
get power(): _Foundation_Measurement<_Foundation_UnitPower>
Swift declaration
let power: Measurement<UnitPower>

The instantaneous power in milli-watts [mW] of the reporting device.

get · iOS 26.0+

energy

TypeScript
get energy(): _Foundation_Measurement<_Foundation_UnitEnergy>
Swift declaration
let energy: Measurement<UnitEnergy>

The cumulative energy in milli-watt-hours [mWh] of the reporting device rounded to the nearest integer. The accumulator is reset on ``Session/State/end``.

get · iOS 26.0+

direction

TypeScript
get direction(): ElectricityFlowDirection
Swift declaration
let direction: ElectricityFlowDirection

The electricity being imported or exported to the grid.

Skipped declarations

No declarations were skipped in this snapshot.

All EnergyKit types →