Capabilities

State

Capabilities

Declaration

getCapabilities()

Example

val state:Capabilities.State
assertTrue(state.capabilities[0].value?.capabilityID == 0x0020)
assertTrue(state.capabilities[0].value?.supportedPropertyIDs == Bytes(byteArrayOf(0x02, 0x03, 0x04, 0x05, 0x06)))
// Doors supports inside locks, locks, positions, inside locks state and locks state properties

Webhooks

Declaration

getWebhooks()

Example

val state:Capabilities.State
assertTrue(state.webhooks[0].value?.available == Webhook.Available.AVAILABLE)
assertTrue(state.webhooks[0].value?.event == Event.TRIP_STARTED)
// Webhook 'trip_started' is available to use.

Getters

Get capabilities

Declaration

public GetCapabilities()
public GetCapabilities(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetCapabilities()
// get capability and webhook properties
val getStateProperties = GetCapabilities(0x01, 0x02)