struct BalanceStructRepresents a step along a scale of preferences.
-
The relative value, in percentage, along a scale of preferences. Supported values:
0: The device entirely favors the priority specified by the first element in theenergyPrioritiesattribute.50: The device splits its energy consumption between the two priorities in theenergyPrioritiesattribute.100: The device entirely favors the priority specified by the second element in theenergyPrioritiesattribute.
Declaration
Swift
let step: UInt8 -
An optional string explaining which actions a device might take at the given
stepvalue.Declaration
Swift
let label: 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 -
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)?