struct TargetDeviceRepresents 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)? -
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.parseErrorwhen parsing fails.Declaration
Swift
init(decoder: TraitDecoder) throwsParameters
decoderThe raw data representing this Struct.
-
Writes this Struct to the given
TraitEncoder. ThrowsHomeError.parseErrorif the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws