# OnOffTrait.Attributes

# OnOffTrait.Attributes


```
@Generated(value = ["GoogleHomePlatformCodegen"])
interface OnOffTrait.Attributes : ClusterStruct
```

<br />

Known direct subclasses [OnOff](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOff)

|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOff` | API for the OnOff trait. |

*** ** * ** ***

Attributes for the OnOff cluster.

## Summary

| ### 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/OnOffTrait.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/OnOffTrait.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. |

| ### Public properties |
|---|---|
| `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/OnOffTrait.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/OnOffTrait.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/OnOffTrait.Attributes#clusterRevision()` The revision of the server cluster specification supported by the cluster instance. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Feature` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.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/OnOffTrait.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/-boolean/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#globalSceneControl()` When set to true, prevents the global scene from being destroyed by subsequent `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffCommands#off()` or `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffCommands#on()` commands. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#offWaitTime()` The length of time (in 0.1 seconds) that the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is false before allowing another `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.OnWithTimedOffCommand.Request` command to turn the device back on. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` Whether the device type implemented on the endpoint is turned off (false) or turned on (true). |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onTime()` The length of time (in 0.1 seconds) that the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is true before changing to false when using the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.OnWithTimedOffCommand.Request` command. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.StartUpOnOffEnum?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#startUpOnOff()` The desired startup behavior of a device when supplied with power. |

## 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

### acceptedCommandList

```
val acceptedCommandList: List<UInt>
```

A list of client-generated commands which are supported by this cluster server instance.

### attributeList

```
val attributeList: List<UInt>
```

A list of the attribute IDs of the attributes supported by the cluster instance.

### clusterRevision

```
val clusterRevision: UShort
```

The revision of the server cluster specification supported by the cluster instance.

### featureMap

```
val featureMap: OnOffTrait.Feature
```

Whether the server supports zero or more optional cluster features. A cluster feature is a set of cluster elements that are mandatory or optional for a defined feature of the cluster. If a cluster feature is supported by the cluster instance, then the corresponding bit is set to 1, otherwise the bit is set to 0 (zero).

### generatedCommandList

```
val generatedCommandList: List<UInt>
```

A list of server-generated commands (server to client) which are supported by this cluster server instance.

### globalSceneControl

```
val globalSceneControl: Boolean?
```

When set to true, prevents the global scene from being destroyed by subsequent `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffCommands#off()` or `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffCommands#on()` commands.

**Access type:** Read

### offWaitTime

```
val offWaitTime: UShort?
```

The length of time (in 0.1 seconds) that the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is false before allowing another `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.OnWithTimedOffCommand.Request` command to turn the device back on.

**Access type:** Write

### onOff

```
val onOff: Boolean?
```

Whether the device type implemented on the endpoint is turned off (false) or turned on (true).

**Access type:** Read

### onTime

```
val onTime: UShort?
```

The length of time (in 0.1 seconds) that the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is true before changing to false when using the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.OnWithTimedOffCommand.Request` command.

**Access type:** Write

### startUpOnOff

```
val startUpOnOff: OnOffTrait.StartUpOnOffEnum?
```

The desired startup behavior of a device when supplied with power. If not set, the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is set to its previous value.

**Access type:** Write