struct ModeTagStructDescribes a mode tag. The same manufacturer code and mode tag value in separate cluster instances are part of the same namespace and have the same meaning. For example, a manufacturer tag meaning “pinch” can be used both in a cluster whose purpose is to choose the amount of sugar, or in a cluster whose purpose is to choose the amount of salt.
-
The manufacturer’s vendor ID.
Declaration
Swift
let mfgCode: UInt16? -
The mode tag within a mode tag namespace. If the
mfgCodefield exists, this is set to a manufacturer-defined value, otherwise, it’s set to a standard value.Declaration
Swift
let value: UInt16 -
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 -
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)?