TargetDevice

struct TargetDevice

Represents a target device with its type info.

  • Returns the field corresponding to the given field ID.

    Declaration

    Swift

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

    The ID of the target device. For example, ‘device@{uuid}’.

    Declaration

    Swift

    let id: String?
  • The device type that represents the device’s capability. For example, ‘home.matter.0000.types.010d’.

    Declaration

    Swift

    let type: String?
  • 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.

  • 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