# Updater

# Updater


```
class Updater<T : Trait>
```

<br />

*** ** * ** ***

Trait attribute updater that builds the list of attributes to be updated.

## Summary

| ### Public constructors |
|---|
| `<T : https://developers.home.google.com/reference/kotlin/com/google/home/Trait> https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater#Updater()()` |

| ### Public functions |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater<T>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater#addUpdate(kotlin.Function1)(updaterBlock: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater<T>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Add an attribute update to the list of attributes to be updated. |
| `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/Updater#getUpdatesMap()()` Get the map of attributes to be updated. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/AttributeToUpdate>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater#attributesToUpdate()` |

## Public constructors

### Updater

```
<T : Trait> Updater()
```

## Public functions

### addUpdate

```
fun addUpdate(updaterBlock: Updater<T>.() -> Unit): Updater<T>
```

Add an attribute update to the list of attributes to be updated.

| Parameters |
|---|---|
| `updaterBlock: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater<T>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | The block of `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater` code |

### getUpdatesMap

```
fun getUpdatesMap(): Map<Field, Any?>
```

Get the map of attributes to be updated.

| Returns |
|---|---|
| `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?>` | The map of attributes to be updated. |

## Public properties

### attributesToUpdate

```
val attributesToUpdate: MutableList<AttributeToUpdate>
```