IotDevice

IotDevice

The IotDevice offers you a function newRequest(). It gives you a StateChangeRequest.Builder.

val stateChangeRequest: StateChangeRequest = iotDevice.newRequest().apply {
  addState(property, value)
}

The StateChangeRequest can then be used as a parameter given to the execute() function of the IotDeviceController interface: iotDeviceController.execute(stateChangeRequest)