# DeviceEnergyManagementTrait.ForecastStruct


```
class DeviceEnergyManagementTrait.ForecastStruct : ClusterStruct
```

<br />

*** ** * ** ***

Indicates a list of `slots` to describe the overall timing of the ESA's planned energy and power usage, with different power and energy demands for each slot. For example, slots might be used to describe the distinct stages of a washing machine cycle.

## 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/DeviceEnergyManagementTrait.ForecastStruct.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/DeviceEnergyManagementTrait.ForecastStruct#ForecastStruct(kotlin.UInt,kotlin.UShort,kotlin.UInt,kotlin.UInt,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue,kotlin.Boolean,kotlin.collections.List,com.google.home.matter.standard.DeviceEnergyManagementTrait.ForecastUpdateReasonEnum)( forecastId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html, activeSlotNumber: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?, startTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html, endTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html, earliestStartTime: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?>, latestEndTime: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>, isPausable: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html, slots: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.SlotStruct>, forecastUpdateReason: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastUpdateReasonEnum )` Creates the ForecastStruct 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/DeviceEnergyManagementTrait.ForecastStruct#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/DeviceEnergyManagementTrait.ForecastStruct#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://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#activeSlotNumber()` Indicates which element of the `Slots` list is currently active in the forecast sequence. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#earliestStartTime()` The earliest time, in UTC, that the ESA can start the forecast sequence. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#endTime()` The planned end time, in UTC, for the entire forecast. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#forecastId()` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastUpdateReasonEnum` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#forecastUpdateReason()` The reason for updating the forecast. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#isPausable()` Indicates that some part of the forecast can be paused. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#latestEndTime()` The latest end time, in UTC, for the entire forecast. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.SlotStruct>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#slots()` A list of `SlotStructs` where the list must contain at least one entry but no more than 10. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ForecastStruct#startTime()` The planned start time, in UTC, for the entire forecast. |

## Public constructors

### ForecastStruct

```
ForecastStruct(
    forecastId: UInt,
    activeSlotNumber: UShort? = null,
    startTime: UInt,
    endTime: UInt,
    earliestStartTime: OptionalValue<UInt?> = OptionalValue.absent(),
    latestEndTime: OptionalValue<UInt> = OptionalValue.absent(),
    isPausable: Boolean = false,
    slots: List<DeviceEnergyManagementTrait.SlotStruct> = emptyList(),
    forecastUpdateReason: DeviceEnergyManagementTrait.ForecastUpdateReasonEnum = ForecastUpdateReasonEnum.InternalOptimization
)
```

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

### activeSlotNumber

```
val activeSlotNumber: UShort?
```

Indicates which element of the `Slots` list is currently active in the forecast sequence. A null value indicates that the sequence has not yet started.

### earliestStartTime

```
val earliestStartTime: OptionalValue<UInt?>
```

The earliest time, in UTC, that the ESA can start the forecast sequence.

### endTime

```
val endTime: UInt
```

The planned end time, in UTC, for the entire forecast.

### forecastId

```
val forecastId: UInt
```

### forecastUpdateReason

```
val forecastUpdateReason: DeviceEnergyManagementTrait.ForecastUpdateReasonEnum
```

The reason for updating the forecast.

### isPausable

```
val isPausable: Boolean
```

Indicates that some part of the forecast can be paused.

### latestEndTime

```
val latestEndTime: OptionalValue<UInt>
```

The latest end time, in UTC, for the entire forecast.

### slots

```
val slots: List<DeviceEnergyManagementTrait.SlotStruct>
```

A list of `SlotStructs` where the list must contain at least one entry but no more than 10.

### startTime

```
val startTime: UInt
```

The planned start time, in UTC, for the entire forecast.