struct ColorPresetA set of colors and a brightness level that can be applied to a structure’s light sources.
-
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)? -
The unique identifier for the color preset.
Declaration
Swift
let identifier: Int32? -
The name of the color preset.
Declaration
Swift
let name: String? -
The list of colors that make up the color preset.
Declaration
Swift
let colorArray: [Google.ColorPresetsTrait.Color] -
The brightness level of the color preset, whose range of allowed values is determined by the Level cluster.
Declaration
Swift
let brightness: UInt32? -
The order of this color preset in the list of presets.
Declaration
Swift
let order: UInt32? -
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