# LevelControlTrait.StepWithOnOffCommand

# LevelControlTrait.StepWithOnOffCommand


```
object LevelControlTrait.StepWithOnOffCommand : CommandDescriptor
```

<br />

*** ** * ** ***

Move a device's level a specific amount over a period of time and toggle the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute of the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOff` cluster depending on the end value of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.Attributes#currentLevel()`.

If the `stepSize` used results in a `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.Attributes#currentLevel()` that is greater than the `maxLevel` or less than the `minLevel`, then the command stops when the `currentLevel` reaches the `maxLevel` or `minLevel`, respectively.

The command may complete in a shorter time than specified for `transitionTime` if the `maxLevel` or `minLevel` is reached before the transition time is over.

If this command sets the `currentLevel` above the `minLevel`, the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is set to true.

If this command sets the `currentLevel` to the `minLevel`, the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OnOffTrait.Attributes#onOff()` attribute is set to false.

| See also |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlCommands#stepWithOnOff(com.google.home.matter.standard.LevelControlTrait.StepModeEnum,kotlin.UByte,kotlin.UShort,com.google.home.matter.standard.LevelControlTrait.OptionsBitmap,com.google.home.matter.standard.LevelControlTrait.OptionsBitmap)` | Use this command from the `trait(LevelControl)` method. |

## Summary

| ### Nested types |
|---|
| `class https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.StepWithOnOffCommand.Request : https://developers.home.google.com/reference/kotlin/com/google/home/ClusterStruct` The request payload for the StepWithOnOff command. |
| `@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/LevelControlTrait.StepWithOnOffCommand.Request.CommandFields : 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 command's request fields. |

| ### Public functions |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/Field?` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.StepWithOnOffCommand#getCommandRequestFieldByName(kotlin.String)(name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` |

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.StepWithOnOffCommand#commandId()` Unique id corresponding to the command. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.StepWithOnOffCommand#commandName()` Human-friendly name of the command. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-nothing/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/LevelControlTrait.StepWithOnOffCommand#responseId()` Optional (for Matter only) ScopedCommandId corresponding to the command response (if any). |

## Public functions

### getCommandRequestFieldByName

```
@HomeExperimentalGenericApi
open fun getCommandRequestFieldByName(name: String): Field?
```

## Public properties

### commandId

```
open val commandId: String
```

Unique id corresponding to the command.

### commandName

```
open val commandName: String
```

Human-friendly name of the command.

### responseId

```
open val responseId: Nothing?
```

Optional (for Matter only) ScopedCommandId corresponding to the command response (if any).