Sensorberg Smart Spaces SDK for Android / com.sensorberg.smartworkspace.sdk / UnitController

UnitController

interface UnitController

Controller for a IotUnit.

Types

Status

sealed class Status

Base class for the possible statuses of the UnitController

Functions

action

abstract fun action(requests: List<IotDeviceRequest>): LiveData<SimpleResponse<Void>>

Execute the specific action to the device with optional parameters. The action depends on the unit type, e.g. Doors and Lockers Box action is open

getDeviceState

abstract fun getDeviceState(iotDeviceIds: List<String>): LiveData<SimpleResponse<List<IotDevice>>>

Get state of the requested IotDevice IDs

getStatus

abstract fun getStatus(): LiveData<Status>

Get a LiveData with the Status of this controller.

getUnits

abstract fun getUnits(availability: Availability, proximity: Sorting, type: Type? = null): LiveData<SimpleResponse<List<IotUnit>>>

Get a LiveData for all the IotUnit the given the parameters. This data should be observed for as long as needed as calls to SmartWorkspaceSdk.refresh will be update it.

open

abstract fun open(openable: Openable, cancellationSignal: CancellationSignal?): LiveData<Response<IotUnit, OpeningProgress>>

Open the specified Openable. Some IotUnit must be booked before they can be opened. See BookingManager. Returns a LiveData with the status of the operation.