EnergyPreferenceTrait.BalanceStruct

class EnergyPreferenceTrait.BalanceStruct : ClusterStruct


Represents a step along a scale of preferences.

Summary

Nested types

Descriptor enum for this struct's fields.

Public constructors

Creates the BalanceStruct 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<String>

An optional string explaining which actions a device might take at the given step value.

UByte

The relative value, in percentage, along a scale of preferences.

Public constructors

BalanceStruct

BalanceStruct(
    step: UByte,
    label: OptionalValue<String> = OptionalValue.absent()
)

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

label

val labelOptionalValue<String>

An optional string explaining which actions a device might take at the given step value.

step

val stepUByte

The relative value, in percentage, along a scale of preferences. Supported values:

  • 0: The device entirely favors the priority specified by the first element in the energyPriorities attribute.
  • 50: The device splits its energy consumption between the two priorities in the energyPriorities attribute.
  • 100: The device entirely favors the priority specified by the second element in the energyPriorities attribute.