# OperationalStateTrait.OperationalStateStruct

# OperationalStateTrait.OperationalStateStruct


```
class OperationalStateTrait.OperationalStateStruct : ClusterStruct
```

<br />

*** ** * ** ***

Used to indicate a possible state of the device.

## 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/OperationalStateTrait.OperationalStateStruct.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/OperationalStateTrait.OperationalStateStruct#OperationalStateStruct(kotlin.UByte,com.google.home.matter.serialization.OptionalValue)( operationalStateId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html, operationalStateLabel: 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 OperationalStateStruct 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/OperationalStateTrait.OperationalStateStruct#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/OperationalStateTrait.OperationalStateStruct#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-byte/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OperationalStateTrait.OperationalStateStruct#operationalStateId()` |
| `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/OperationalStateTrait.OperationalStateStruct#operationalStateLabel()` A human-readable description of the operational state. |

## Public constructors

### OperationalStateStruct

```
OperationalStateStruct(
    operationalStateId: UByte,
    operationalStateLabel: OptionalValue<String> = OptionalValue.absent()
)
```

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

### operationalStateId

```
val operationalStateId: UByte
```

### operationalStateLabel

```
val operationalStateLabel: OptionalValue<String>
```

A human-readable description of the operational state. Only present when the `operationalStateId` is vendor-specific.