> Documentation index: https://developers.home.google.com/apis/android/commissioning/llms.txt

Traits that can be used after the device has been commissioned are:

- [`OtaSoftwareUpdateRequestor`](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OtaSoftwareUpdateRequestor.md.txt)
- [`ConfigurationDone`](https://developers.home.google.com/reference/kotlin/com/google/home/google/ConfigurationDone.md.txt)

> [!WARNING]
> **Warning:** These traits are restricted and not available for general use.

## OtaSoftwareUpdateRequestor trait

[Implemented in Sample App for Android](https://developers.home.google.com/apis/android/sample-app/build.md.txt)

This trait provides an interface to monitor an OTA software update
on the camera device. Once commissioned, the camera
initiates the update and reports its state to the app. Once the app
receives the status that the software update is complete, the
camera can begin to livestream.

The following sample code and explanation demonstrate how the trait can be used.

```kotlin
withTimeout(OTA_TIMEOUT_MS) {
  device.type(OtaRequestorDevice)
    .mapNotNull { it?.trait(OtaSoftwareUpdateRequestor) }
    .distinctUntilChanged()
    .transformWhile { trait ->
      emit(trait)
      !isTerminalState(trait.updateState)
    }
    .collect { trait ->
      updateState = trait.updateState
      updateStateProgress = trait.updateStateProgress
    }
}
```

- Timeout: `withTimeout` enforces a maximum duration (`OTA_TIMEOUT_MS`)
  for the monitoring process. If the update doesn't complete within this time,
  it times out.

- Observing trait changes: The `.distinctUntilChanged()` operator
  ensures that the subsequent code in the chain only reacts when the state of
  the trait actually changes, which makes this more efficient than constant
  polling.

- Processing until completion: The `.transformWhile` operator continues
  processing updates as long as the OTA `updateState` is not a
  terminal state (such as success or failure).

- Collecting status: For each state change, the `.collect` block is executed
  to update the `updateState` and `updateStateProgress` variables with the
  latest values from the trait.

For more information, refer to the
[`OtaSoftwareUpdateRequestor` trait reference](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/OtaSoftwareUpdateRequestor.md.txt).

## ConfigurationDone trait

This trait is not required for camera activation, but it allows the app
to track when the device is fully set up and usable by setting the
`AppConfigurationComplete` attribute to `true`.
This trait should be used after the `OtaSoftwareUpdateRequestor` trait.

```kotlin
device.trait(ConfigurationDone).first().update { setAppConfigurationComplete(true) }
```