# HomeObjectsFlow

# HomeObjectsFlow


```
class HomeObjectsFlow<T : HasId> : Flow
```

<br />

*** ** * ** ***

A `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of a `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html` of home objects. A new value is emitted on the flow whenever any object in the set changes.

`https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#list()`, `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#itemFlow(com.google.home.Id)`, and `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#get(com.google.home.Id)` are provided as convenience methods for common operations.

## Summary

| ### Public functions |
|---|---|
| `suspend T?` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#get(com.google.home.Id)(id: https://developers.home.google.com/reference/kotlin/com/google/home/Id)` Gets the latest value of the home object with the corresponding `https://developers.home.google.com/reference/kotlin/com/google/home/Id` and terminates the subscription. |
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<T>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#itemFlow(com.google.home.Id)(id: https://developers.home.google.com/reference/kotlin/com/google/home/Id)` Creates a filtered flow of distinct items given an `https://developers.home.google.com/reference/kotlin/com/google/home/Id`. |
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<T>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#itemFlow(com.google.home.HasId)(item: T)` Creates a filtered flow of items that match the item type. |
| `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<T>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#list()()` Gets the latest value of the home objects and terminates the subscription. |
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectChangeEvent<T>>` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalApi https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#stream()()` Converts the current flow into a streaming event flow for objects added, modified, deleted or initialized. |

| ### Public properties |
|---|---|
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<T>>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeObjectsFlow#flow()` the Set of home objects used by the Flow. |

| ### Inherited functions |
|---|
| From [kotlinx.coroutines.flow.Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html) |---|---| | `open suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/collect.html(collector: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow-collector/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<T>>)` | |

## Public functions

### get

```
suspend fun get(id: Id): T?
```

Gets the latest value of the home object with the corresponding `https://developers.home.google.com/reference/kotlin/com/google/home/Id` and terminates the subscription.

| Parameters |
|---|---|
| `id: https://developers.home.google.com/reference/kotlin/com/google/home/Id` | the ID of the item to get. |

| Returns |
|---|---|
| `T?` | the latest value of the item. |

### itemFlow

```
fun itemFlow(id: Id): Flow<T>
```

Creates a filtered flow of distinct items given an `https://developers.home.google.com/reference/kotlin/com/google/home/Id`.

| Parameters |
|---|---|
| `id: https://developers.home.google.com/reference/kotlin/com/google/home/Id` | the ID of the item to create a flow for. |

| Returns |
|---|---|
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<T>` | the filtered flow. |

### itemFlow

```
fun itemFlow(item: T): Flow<T>
```

Creates a filtered flow of items that match the item type.

| Parameters |
|---|---|
| `item: T` | the item type to create a flow for. |

| Returns |
|---|---|
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<T>` | the filtered flow. |

### list

```
suspend fun list(): Set<T>
```

Gets the latest value of the home objects and terminates the subscription.

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html<T>` | the latest value of the item. |

### stream

```
@HomeExperimentalApi
fun stream(): Flow<HomeObjectChangeEvent<T>>
```

Converts the current flow into a streaming event flow for objects added, modified, deleted or initialized.

## Public properties

### flow

```
val flow: Flow<Set<T>>
```

the Set of home objects used by the Flow.