DeviceEnergyManagementTrait.CostStruct

class DeviceEnergyManagementTrait.CostStruct : ClusterStruct


Indicates a generic mechanism for expressing the cost to run an appliance.

Summary

Nested types

Descriptor enum for this struct's fields.

Public constructors

CostStruct(
    costType: DeviceEnergyManagementTrait.CostTypeEnum,
    value: Int,
    decimalPoints: UByte,
    currency: OptionalValue<UShort>
)

Creates the CostStruct 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

DeviceEnergyManagementTrait.CostTypeEnum

The type of cost being represented.

OptionalValue<UShort>

Indicates the currency for the value in the Value field.

UByte

The number of digits to the right of the decimal point in the Value field.

Int

The value of the cost.

Public constructors

CostStruct

CostStruct(
    costType: DeviceEnergyManagementTrait.CostTypeEnum = CostTypeEnum.Financial,
    value: Int = 0,
    decimalPoints: UByte,
    currency: OptionalValue<UShort> = OptionalValue.absent()
)

Creates the CostStruct class.

Public functions

getDescriptor

@HomeExperimentalGenericApi
open fun getDescriptor(): StructDescriptor

Returns the descriptor for the struct.

getFieldValueById

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

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

Public properties

costType

val costTypeDeviceEnergyManagementTrait.CostTypeEnum

The type of cost being represented.

currency

val currencyOptionalValue<UShort>

Indicates the currency for the value in the Value field. The value of the currency field must match the values defined by ISO 4217.

decimalPoints

val decimalPointsUByte

The number of digits to the right of the decimal point in the Value field. For example, if the value is 102 and DecimalPointsis 2, this would represent a cost of 1.02.

value

val valueInt

The value of the cost. A positive number indicates a cost, and a negative number indicates a free benefit.