# EnergyPreferenceTrait.BalanceStruct


```
class EnergyPreferenceTrait.BalanceStruct : ClusterStruct
```

<br />

*** ** * ** ***

Represents a step along a scale of preferences.

## Summary

| ### Nested types |
|---|
| `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct.StructFields : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/Field` Descriptor enum for this struct's fields. |

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct#BalanceStruct(kotlin.UByte,com.google.home.matter.serialization.OptionalValue)(step: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html, label: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>)` Creates the BalanceStruct class. |

| ### Public functions |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/StructDescriptor` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct#getDescriptor()()` Returns the descriptor for the struct. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct#getFieldValueById(kotlin.UInt)(tagId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html)` Returns the value of the field for the given tag ID. |

| ### Public properties |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct#label()` An optional string explaining which actions a device might take at the given `step` value. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct#step()` 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 label: OptionalValue<String>
```

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

### step

```
val step: UByte
```

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.

<br />