# EnergyPreference


```
@Generated(value = ["GoogleHomePlatformCodegen"])
interface EnergyPreference : EnergyPreferenceTrait.Attributes, MatterTrait, Updatable
```

<br />

*** ** * ** ***

API for the EnergyPreference trait. This trait provides an interface to specify preferences for how devices should consume energy.

## Summary

| ### Nested types |
|---|
| `enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference.Attribute : 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 trait's attributes. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference#supports(com.google.home.matter.standard.EnergyPreference.Attribute)(attribute: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference.Attribute)` |

| ### Public properties |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference#factory()` |

### Inherited functions

From [com.google.home.matter.standard.EnergyPreferenceTrait.Attributes](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes) `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.Attributes#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.Attributes#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.
From [com.google.home.TraitStateInvalidation](https://developers.home.google.com/reference/kotlin/com/google/home/TraitStateInvalidation) `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://developers.home.google.com/reference/kotlin/com/google/home/TraitStateInvalidation#forceRead()()` From [com.google.home.Updatable](https://developers.home.google.com/reference/kotlin/com/google/home/Updatable) `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference` `https://developers.home.google.com/reference/kotlin/com/google/home/Updatable#update(kotlin.Function1,kotlin.Function1)(optimisticReturn: (https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreference) -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html, init: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.MutableAttributes.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`

Creates a mutable copy of an object and calls the given function to mutate it, then saves it and returns a new immutable copy with the updated state.

### Inherited properties

From [com.google.home.matter.standard.EnergyPreferenceTrait.Attributes](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#acceptedCommandList()`

A list of client-generated commands which are supported by this cluster server instance.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#attributeList()`

A list of the attribute IDs of the attributes supported by the cluster instance.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#clusterRevision()`

The revision of the server cluster specification supported by the cluster instance.
`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.Attributes#currentEnergyBalance()`

The current preference of the user for balancing different priorities during device use.
`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.Attributes#currentLowPowerModeSensitivity()`

The current preference of the user for how quickly a device should enter low power mode.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct>?` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#energyBalances()`

A list of at least two `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct`, each representing a step along a linear scale of relative priorities.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.EnergyPriorityEnum>?` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#energyPriorities()`

Two extremes for interpreting the values in the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#energyBalances()` attribute.
`https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Feature` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#featureMap()`

Whether the server supports zero or more optional cluster features.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#generatedCommandList()`

A list of server-generated commands (server to client) which are supported by this cluster server instance.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct>?` `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.Attributes#lowPowerModeSensitivities()`

A list of at least two `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/EnergyPreferenceTrait.BalanceStruct`, each representing a condition or set of conditions for the device to enter low-power mode.
From [com.google.home.Trait](https://developers.home.google.com/reference/kotlin/com/google/home/Trait) `https://developers.home.google.com/reference/kotlin/com/google/home/Trait.TraitMetadata` `https://developers.home.google.com/reference/kotlin/com/google/home/Trait#metadata()`

## Public functions

### supports

```
fun supports(attribute: EnergyPreference.Attribute): Boolean
```

## Public properties

### factory

```
open val factory: TraitFactory<EnergyPreference>
```