# Update

# Update


```
class Update : ActionBehavior
```

<br />

*** ** * ** ***

Trait attribute update used in automation action.

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Update#Update(com.google.home.TraitFactory,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>, updatedAttributes: 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 an `Update` instance. |

| ### Public properties |
|---|---|
| `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/Update#trait()` The trait to update. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Update#traitId()` |
| `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/Update#updatedAttributes()` Key-value pairs representing the attributes to update, where the key is the attribute field ID, and the value is the new attribute value. |

## Public constructors

### Update

```
Update(
    trait: TraitFactory<Trait>,
    updatedAttributes: Map<Field, Any?> = emptyMap()
)
```

Create an `Update` instance.

## Public properties

### trait

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

The trait to update.

### traitId

```
val traitId: String
```

### updatedAttributes

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

Key-value pairs representing the attributes to update, where the key is the attribute field ID, and the value is the new attribute value.