HomeConfig

class HomeConfig


Stores common config for configuring the behavior of the SDK.

Summary

Public companion properties

Boolean

Public constructors

HomeConfig(
    strictOperationValidation: Boolean,
    coroutineContext: CoroutineContext?,
    factoryRegistry: FactoryRegistry,
    serverClientId: String?
)
HomeConfig(
    strictOperationValidation: Boolean,
    coroutineContext: CoroutineContext?,
    factoryRegistryProvider: () -> FactoryRegistry,
    serverClientId: String?
)

Public properties

CoroutineContext?

Coroutine context for the Home API.

FactoryRegistry
() -> FactoryRegistry

Provider for the FactoryRegistry to be used by the SDK.

CoroutineScope
String?

The server client id for OAuth.

Boolean

If true, throws an exception when interacting with an unsupported trait or command.

Public companion properties

DEFAULT_STRICT_OPERATION_VALIDATION

val DEFAULT_STRICT_OPERATION_VALIDATIONBoolean

Public constructors

HomeConfig

HomeConfig(
    strictOperationValidation: Boolean = DEFAULT_STRICT_OPERATION_VALIDATION,
    coroutineContext: CoroutineContext? = null,
    factoryRegistry: FactoryRegistry = FactoryRegistry(),
    serverClientId: String? = null
)

HomeConfig

HomeConfig(
    strictOperationValidation: Boolean = DEFAULT_STRICT_OPERATION_VALIDATION,
    coroutineContext: CoroutineContext? = null,
    factoryRegistryProvider: () -> FactoryRegistry,
    serverClientId: String? = null
)

Public properties

coroutineContext

val coroutineContextCoroutineContext?

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 factoryRegistryFactoryRegistry

factoryRegistryProvider

val factoryRegistryProvider: () -> FactoryRegistry

Provider for the 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 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.

scope

val scopeCoroutineScope

serverClientId

val serverClientIdString?

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 strictOperationValidationBoolean

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.