DispenseItem

struct DispenseItem

The state of a given disensible item.

  • 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.

    Declaration

    Swift

    let amountLastDispensed: Google.DispenseTrait.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.

    Declaration

    Swift

    let amountRemaining: Google.DispenseTrait.Amount
  • Writes this Struct to the given TraitEncoder. Throws HomeError.parseError if the data could not be encoded.

    Declaration

    Swift

    func encode(with encoder: TraitEncoder) throws
  • Creates a new Struct instance using data read from the given TraitDecoder.

    Throws

    HomeError.parseError when parsing fails.

    Declaration

    Swift

    init(decoder: TraitDecoder) throws

    Parameters

    decoder

    The raw data representing this Struct.

  • Indicates if the device is currently dispensing this item.

    Declaration

    Swift

    let isCurrentlyDispensing: Bool
  • Name of the item.

    Declaration

    Swift

    let itemName: String
  • Returns the field corresponding to the given field ID.

    Declaration

    Swift

    static func structField(id: UInt32) -> (any Field)?