ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct

class ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct : ClusterStruct


Indicates the amount of energy measured during a given measurement period.

Summary

Nested types

Descriptor enum for this struct's fields.

Public constructors

EnergyMeasurementStruct(
    energy: Long,
    startTimestamp: OptionalValue<UInt>,
    endTimestamp: OptionalValue<UInt>,
    startSystime: OptionalValue<ULong>,
    endSystime: OptionalValue<ULong>,
    apparentEnergy: OptionalValue<Long>,
    reactiveEnergy: OptionalValue<Long>
)

Creates the EnergyMeasurementStruct class.

Public functions

open StructDescriptor

Returns the descriptor for the struct.

open Any?

Returns the value of the field for the given tag ID.

Public properties

OptionalValue<Long>
OptionalValue<ULong>

The time, in milliseconds, since boot at the end of the measurement period.

OptionalValue<UInt>

The timestamp in UTC of the end of the measurement period.

Long

The reported energy.

OptionalValue<Long>
OptionalValue<ULong>

The time, in milliseconds, since boot at the start of the measurement period.

OptionalValue<UInt>

The timestamp in UTC of the start of the measurement period.

Public constructors

EnergyMeasurementStruct

EnergyMeasurementStruct(
    energy: Long = 0,
    startTimestamp: OptionalValue<UInt> = OptionalValue.absent(),
    endTimestamp: OptionalValue<UInt> = OptionalValue.absent(),
    startSystime: OptionalValue<ULong> = OptionalValue.absent(),
    endSystime: OptionalValue<ULong> = OptionalValue.absent(),
    apparentEnergy: OptionalValue<Long> = OptionalValue.absent(),
    reactiveEnergy: OptionalValue<Long> = OptionalValue.absent()
)

Creates the EnergyMeasurementStruct class.

Public functions

getDescriptor

@HomeExperimentalApi
open fun getDescriptor(): StructDescriptor

Returns the descriptor for the struct.

getFieldValueById

@HomeExperimentalApi
open fun getFieldValueById(tagId: UInt): Any?

Returns the value of the field for the given tag ID.

Public properties

apparentEnergy

val apparentEnergyOptionalValue<Long>

endSystime

val endSystimeOptionalValue<ULong>

The time, in milliseconds, since boot at the end of the measurement period.

endTimestamp

val endTimestampOptionalValue<UInt>

The timestamp in UTC of the end of the measurement period.

energy

val energyLong

The reported energy.

reactiveEnergy

val reactiveEnergyOptionalValue<Long>

startSystime

val startSystimeOptionalValue<ULong>

The time, in milliseconds, since boot at the start of the measurement period.

startTimestamp

val startTimestampOptionalValue<UInt>

The timestamp in UTC of the start of the measurement period.