energyInsights(forDeviceID:using:atVenue:)
Returns data that provides insight into electrical usage for a given device.
Declaration
final func energyInsights(forDeviceID deviceID: String, using query: ElectricityInsightQuery, atVenue energyVenueID: UUID) async throws -> AsyncStream<ElectricityInsightRecord<Measurement<UnitEnergy>>>Parameters
- deviceID:
The device identifier to return Electricityinsightrecords for.
- query:
The Electricityinsightquery to specify the results.
- energyVenueID:
The Energyvenue identifier to return Electricityinsightrecords for.
Return Value
An AsyncStream of ElectricityInsightRecords containing UnitEnergy values for a given device.
Discussion
The system throws EnergyKitError.venueUnavailable if a person provides an invalid EnergyVenue identifier. If another request is in progress, the system throwsEnergyKitError.inProgress.