# HomeConfig


```
class HomeConfig
```

<br />

*** ** * ** ***

Stores common config for configuring the behavior of the SDK.

## Summary

| ### Nested types |
|---|
| `enum https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig.HomePlatformScope : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html` The selected device scopes version to use when initializing the SDK. |

| ### Public companion properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#DEFAULT_STRICT_OPERATION_VALIDATION()` |

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#HomeConfig(kotlin.Boolean,kotlin.coroutines.CoroutineContext,com.google.home.FactoryRegistry,kotlin.String,com.google.home.HomeConfig.HomePlatformScope)( strictOperationValidation: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html, coroutineContext: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html?, factoryRegistry: https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry, serverClientId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?, homePlatformScope: https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig.HomePlatformScope )` Public constructor for third-party clients. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#HomeConfig(kotlin.Boolean,kotlin.coroutines.CoroutineContext,kotlin.Function0,kotlin.String,com.google.home.HomeConfig.HomePlatformScope)( strictOperationValidation: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html, coroutineContext: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html?, factoryRegistryProvider: () -> https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry, serverClientId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?, homePlatformScope: https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig.HomePlatformScope )` Public constructor for third-party clients with lazy factory registry provider. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#coroutineContext()` Coroutine context for the Home API. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#factoryRegistry()` |
| `() -> https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#factoryRegistryProvider()` Provider for the `https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry` to be used by the SDK. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig.HomePlatformScope` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#homePlatformScope()` The GHP feature scope to use. |
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#scope()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#serverClientId()` The server client id for OAuth. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig#strictOperationValidation()` If true, throws an exception when interacting with an unsupported trait or command. |

## Public companion properties

### DEFAULT_STRICT_OPERATION_VALIDATION

```
val DEFAULT_STRICT_OPERATION_VALIDATION: Boolean
```

## Public constructors

### HomeConfig

```
HomeConfig(
    strictOperationValidation: Boolean = DEFAULT_STRICT_OPERATION_VALIDATION,
    coroutineContext: CoroutineContext? = null,
    factoryRegistry: FactoryRegistry = FactoryRegistry(),
    serverClientId: String? = null,
    homePlatformScope: HomeConfig.HomePlatformScope = HomePlatformScope.HOME_PLATFORM_SCOPE_VERSION_1
)
```

Public constructor for third-party clients.

| Parameters |
|---|---|
| `strictOperationValidation: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html = DEFAULT_STRICT_OPERATION_VALIDATION` | If true, throws an exception when interacting with an unsupported trait or command. |
| `coroutineContext: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html? = null` | Coroutine context for the Home API. |
| `factoryRegistry: https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry = FactoryRegistry()` | A registry of traits and device types to be used by the SDK. |
| `serverClientId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html? = null` | The server client id for OAuth. |
| `homePlatformScope: https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig.HomePlatformScope = HomePlatformScope.HOME_PLATFORM_SCOPE_VERSION_1` | The GHP feature scope to use. |

### HomeConfig

```
HomeConfig(
    strictOperationValidation: Boolean = DEFAULT_STRICT_OPERATION_VALIDATION,
    coroutineContext: CoroutineContext? = null,
    factoryRegistryProvider: () -> FactoryRegistry,
    serverClientId: String? = null,
    homePlatformScope: HomeConfig.HomePlatformScope = HomePlatformScope.HOME_PLATFORM_SCOPE_VERSION_1
)
```

Public constructor for third-party clients with lazy factory registry provider.

| Parameters |
|---|---|
| `strictOperationValidation: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html = DEFAULT_STRICT_OPERATION_VALIDATION` | If true, throws an exception when interacting with an unsupported trait or command. |
| `coroutineContext: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html? = null` | Coroutine context for the Home API. |
| `factoryRegistryProvider: () -> https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry` | Provider for the `https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry` to be used by the SDK. |
| `serverClientId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html? = null` | The server client id for OAuth. |
| `homePlatformScope: https://developers.home.google.com/reference/kotlin/com/google/home/HomeConfig.HomePlatformScope = HomePlatformScope.HOME_PLATFORM_SCOPE_VERSION_1` | The GHP feature scope to use. |

## Public properties

### coroutineContext

```
val coroutineContext: CoroutineContext?
```

Coroutine context for the Home API. MUST be provided for Permissions with OAuth if InteractionClient is null. Should NOT be on the Main thread.

### factoryRegistry

```
val factoryRegistry: FactoryRegistry
```

### factoryRegistryProvider

```
val factoryRegistryProvider: () -> FactoryRegistry
```

Provider for the `https://developers.home.google.com/reference/kotlin/com/google/home/FactoryRegistry` to be used by the SDK. MUST be provided and include any traits and device types the client depends on and uses with the SDK. Otherwise, any operations that require getting traits or device types will fail with a `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException.Codes#SDK_INITIALIZATION_MISSING_INFO()` error. Use the provider to allow for lazy loading of traits and types to reduce initializtion time on the main thread.

### homePlatformScope

```
val homePlatformScope: HomeConfig.HomePlatformScope
```

The GHP feature scope to use. This will be associated with the OAuth token for the user.

### scope

```
val scope: CoroutineScope
```

### serverClientId

```
val serverClientId: String?
```

The server client id for OAuth. This is used to request offline access codes. The presence of this config parameter will be used as a signal to request both offline and online access together when requesting tokens for a user during requestPermissions flow.

### strictOperationValidation

```
val strictOperationValidation: Boolean
```

If true, throws an exception when interacting with an unsupported trait or command. If false will try to send the command/attribute write and return an error if the device does not support it.