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.