# SwitchTrait.Attributes

# SwitchTrait.Attributes


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

<br />

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

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

*** ** * ** ***

Attributes for the Switch 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/SwitchTrait.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/SwitchTrait.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/SwitchTrait.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/SwitchTrait.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/SwitchTrait.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/SwitchTrait.Attributes#currentPosition()` The current position of the switch. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.Feature` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.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/SwitchTrait.Attributes#generatedCommandList()` A list of server-generated commands (server to client) which are supported by this cluster server instance. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.GoogleSyntheticFeatures?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.Attributes#googleSyntheticFeatures()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.Attributes#maxPulsesPerSequence()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.Attributes#multiPressMax()` The maximum number of consecutive presses that can be detected and reported by a momentary switch which supports multi-press. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.Attributes#numberOfPositions()` The maximum number of positions the switch has. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/SwitchTrait.Attributes#pulsesPerRevolution()` |

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

### currentPosition

```
val currentPosition: UByte?
```

The current position of the switch. The default position is `0`. The valid range of values is `0` to `[numberOfPositions]-1`.

**Access type:** Read

### featureMap

```
val featureMap: SwitchTrait.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.

### googleSyntheticFeatures

```
val googleSyntheticFeatures: SwitchTrait.GoogleSyntheticFeatures?
```

### maxPulsesPerSequence

```
val maxPulsesPerSequence: UShort?
```

### multiPressMax

```
val multiPressMax: UByte?
```

The maximum number of consecutive presses that can be detected and reported by a momentary switch which supports multi-press.

**Access type:** Read

### numberOfPositions

```
val numberOfPositions: UByte?
```

The maximum number of positions the switch has. A switch must have a minimum of two positions.

**Access type:** Read

### pulsesPerRevolution

```
val pulsesPerRevolution: UShort?
```