struct EnergyMeasurementStruct
Indicates the amount of energy measured during a given measurement period.
-
The reported energy.
Declaration
Swift
let energy: Int64
-
The timestamp in UTC of the start of the measurement period.
Declaration
Swift
let startTimestamp: UInt32?
-
The timestamp in UTC of the end of the measurement period.
Declaration
Swift
let endTimestamp: UInt32?
-
The time, in milliseconds, since boot at the start of the measurement period.
Declaration
Swift
let startSystime: UInt64?
-
The time, in milliseconds, since boot at the end of the measurement period.
Declaration
Swift
let endSystime: UInt64?
-
Creates a new Struct instance using data read from the given
TraitDecoder
.Throws
HomeError.parseError
when parsing fails.Declaration
Swift
init(decoder: TraitDecoder) throws
Parameters
decoder
The raw data representing this Struct.
-
Writes this Struct to the given
TraitEncoder
. ThrowsHomeError.parseError
if the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws
-
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)?