# Command

# Command


```
class Command : ActionBehavior
```

<br />

*** ** * ** ***

A trait command used in an automation `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`.

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command#Command(com.google.home.TraitFactory,kotlin.String,kotlin.collections.Map)( trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>, command: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, params: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Field, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> )` Create a `Command` instance. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command#command()` The unique identifier for the command. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Field, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command#params()` The parameters for the command. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command#trait()` The `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with the command. |

## Public constructors

### Command

```
Command(
    trait: TraitFactory<Trait>,
    command: String,
    params: Map<Field, Any?> = emptyMap()
)
```

Create a `Command` instance.

## Public properties

### command

```
val command: String
```

The unique identifier for the command.

### params

```
val params: Map<Field, Any?>
```

The parameters for the command.

### trait

```
val trait: TraitFactory<Trait>
```

The `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with the command.