DispenseTrait.DispenseCommand.Request

class DispenseTrait.DispenseCommand.Request : ClusterStruct


The request payload for the Dispense command.

Summary

Nested types

Descriptor enum for this command's request fields.

Public constructors

Request(
    item: String,
    amount: Float,
    unit: DispenseTrait.Unit,
    presetName: String
)

Creates a request payload for the Dispense command.

Public functions

open StructDescriptor

Returns the descriptor for the struct.

open Any?

Returns the value of the field for the given tag ID.

Public properties

Float

Amount to dispense.

String

Name of the item to dispense.

String

Name of the preset to dispense.

DispenseTrait.Unit

Unit for the amount.

Public constructors

Request

Request(
    item: String = "",
    amount: Float = 0.0f,
    unit: DispenseTrait.Unit = Unit.Unspecified,
    presetName: String = ""
)

Creates a request payload for the Dispense command.

Public functions

getDescriptor

@HomeExperimentalApi
open fun getDescriptor(): StructDescriptor

Returns the descriptor for the struct.

getFieldValueById

@HomeExperimentalApi
open fun getFieldValueById(tagId: UInt): Any?

Returns the value of the field for the given tag ID.

Public properties

amount

val amountFloat

Amount to dispense.

item

val itemString

Name of the item to dispense.

presetName

val presetNameString

Name of the preset to dispense.

unit

val unitDispenseTrait.Unit

Unit for the amount.