One Logo Pool Ball
EnergyKit · IOS API REFERENCE

ElectricityInsightService

class · iOS 26.0+ · SDK 27.1

final actor ElectricityInsightService

A service for retrieving insights about electricity consumption.

Members (4)

method · iOS 26.0+

energyInsights

TypeScript
energyInsights(deviceID: string, query: ElectricityInsightQuery, energyVenueID: string): Promise<SDKSequence<ElectricityInsightRecord<_Foundation_Measurement<_Foundation_UnitEnergy>>>>
Swift declaration
final func energyInsights(forDeviceID deviceID: String, using query: ElectricityInsightQuery, atVenue energyVenueID: UUID) async throws -> AsyncStream<ElectricityInsightRecord<Measurement<UnitEnergy>>>

Returns data that provides insight into electrical usage for a given device. The system throws ``EnergyKitError/venueUnavailable`` if a person provides an invalid ``EnergyVenue`` identifier. If another request is in progress, the system throws``EnergyKitError/inProgress``. - Parameters: - deviceID: The device identifier to return ``ElectricityInsightRecord``s for. - query: The ``ElectricityInsightQuery`` to specify the results. - energyVenueID: The ``EnergyVenue`` identifier to return ``ElectricityInsightRecord``s for. - Returns: An `AsyncStream` of ``ElectricityInsightRecord``s containing UnitEnergy values for a given device.

method · iOS 26.0+

runtimeInsights

TypeScript
runtimeInsights(deviceID: string, query: ElectricityInsightQuery, energyVenueID: string): Promise<SDKSequence<ElectricityInsightRecord<SDKHandle>>>
Swift declaration
final func runtimeInsights(forDeviceID deviceID: String, using query: ElectricityInsightQuery, atVenue energyVenueID: UUID) async throws -> AsyncStream<ElectricityInsightRecord<Duration>>

Returns records that provide insight into runtime of a given device. The system throws ``EnergyKitError/venueUnavailable`` if a person provides an invalid ``EnergyVenue`` identifier. If another request is in progress, the system throws``EnergyKitError/inProgress``. - Parameters: - deviceID: The device identifier to return ``ElectricityInsightRecord``s for. - query: The ``ElectricityInsightQuery`` to specify the results. - energyVenueID: The ``EnergyVenue`` identifier to return ``ElectricityInsightRecord``s for. - Returns: An `AsyncStream` of ``ElectricityInsightRecord``s containing `Duration` values for a given device.

get · iOS 26.0+

unownedExecutor

TypeScript
get unownedExecutor(): SDKHandle
Swift declaration
nonisolated final var unownedExecutor: UnownedSerialExecutor { get }

Retrieve the executor for this actor as an optimized, unowned reference. This property must always evaluate to the same executor for a given actor instance, and holding on to the actor must keep the executor alive. This property will be implicitly accessed when work needs to be scheduled onto this actor. These accesses may be merged, eliminated, and rearranged with other work, and they may even be introduced when not strictly required. Visible side effects are therefore strongly discouraged within this property. - SeeAlso: ``SerialExecutor`` - SeeAlso: ``TaskExecutor``

get · iOS 26.0+

shared

TypeScript
static get shared(): ElectricityInsightService
Swift declaration
static let shared: ElectricityInsightService

A single, shared insight service object. Use this object to interact with insight services in your app.

Skipped declarations

No declarations were skipped in this snapshot.

All EnergyKit types →