DispenseTrait.DispenseItem

class DispenseTrait.DispenseItem : ClusterStruct


The state of a given disensible item.

Summary

Nested types

Descriptor enum for this struct's fields.

Public constructors

DispenseItem(
    itemName: String,
    amountRemaining: DispenseTrait.Amount,
    amountLastDispensed: DispenseTrait.Amount,
    isCurrentlyDispensing: Boolean
)

Creates the DispenseItem class.

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

DispenseTrait.Amount

Amount of that item that the device most recently dispensed.

DispenseTrait.Amount

Amount of that item remaining in the device.

Boolean

Indicates if the device is currently dispensing this item.

String

Name of the item.

Public constructors

DispenseItem

DispenseItem(
    itemName: String = "",
    amountRemaining: DispenseTrait.Amount = Amount(),
    amountLastDispensed: DispenseTrait.Amount = Amount(),
    isCurrentlyDispensing: Boolean = false
)

Creates the DispenseItem class.

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

amountLastDispensed

val amountLastDispensedDispenseTrait.Amount

Amount of that item that the device most recently dispensed. If the device is currently dispensing, this should report the amount it dispensed prior to the current dispensing amount.

amountRemaining

val amountRemainingDispenseTrait.Amount

Amount of that item remaining in the device. If the device is currently dispensing, this reports the remaining amount or what the amount will be once the device finishes dispensing.

isCurrentlyDispensing

val isCurrentlyDispensingBoolean

Indicates if the device is currently dispensing this item.

itemName

val itemNameString

Name of the item.