awaitToken

abstract suspend fun awaitToken(appId: AppId, retries: Int = 50, timeout: Duration = 5.seconds): AuthToken

Wait for the user to hit the confirmation button to get a token.

Return

A bearer token to be used with requests to the Hue API. These do not appear to expire. Store it safely.

Parameters

retries

How many times to ask the hue bridge for a token before giving up and timing out. (Default 50)

timeout

The amount of time to wait in-between requests. (Default 5 seconds)