struct Attributes
Attributes for the SwitchTrait
.
-
A list of the attribute IDs of the attributes supported by the cluster instance. Nullable: false.
Declaration
Swift
@TraitAttribute var attributeList: [UInt32]? { get }
-
The maximum number of positions the switch has. A switch must have a minimum of two positions. Nullable: false.
Declaration
Swift
@TraitAttribute var numberOfPositions: UInt8? { get }
-
The current position of the switch. The default position is
0
. The valid range of values is0
to `numberOfPositions
-1`. Nullable: false.Declaration
Swift
@TraitAttribute var currentPosition: UInt8? { get }
-
The maximum number of consecutive presses that can be detected and reported by a momentary switch which supports multi-press. Nullable: false.
Declaration
Swift
@TraitAttribute var multiPressMax: UInt8? { get }
-
A list of server-generated commands (server to client) which are supported by this cluster server instance. Nullable: false.
Declaration
Swift
@TraitAttribute var generatedCommandList: [UInt32]? { get }
-
A list of client-generated commands which are supported by this cluster server instance.
Nullable: false.
Declaration
Swift
@TraitAttribute var acceptedCommandList: [UInt32]? { get }
-
Whether the server supports zero or more optional cluster features. A cluster feature is a set of cluster elements that are mandatory or optional for a defined feature of the cluster. If a cluster feature is supported by the cluster instance, then the corresponding bit is set to 1, otherwise the bit is set to 0 (zero). Nullable: false.
Declaration
Swift
@TraitAttribute var featureMap: Matter.SwitchTrait.Feature? { get }
-
The revision of the server cluster specification supported by the cluster instance. Nullable: false.
Declaration
Swift
@TraitAttribute var clusterRevision: UInt16? { get }
-
Nullable: false.
Declaration
Swift
@TraitAttribute var googleSyntheticFeatures: Matter.SwitchTrait.GoogleSyntheticFeatures? { get }
-
The trait identifier.
Declaration
Swift
static var identifier: String { get }
-
Writes this object to the given
TraitEncoder
. ThrowsHomeError.encodingFailed
if the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
a
andb
,a == b
implies thata != b
isfalse
.Declaration
Swift
static func == (lhs: Matter.SwitchTrait.Attributes, rhs: Matter.SwitchTrait.Attributes) -> Bool
Parameters
lhs
A value to compare.
rhs
Another value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashable
protocol. The components used for hashing must be the same as the components compared in your type’s==
operator implementation. Callhasher.combine(_:)
with each of these components.Important
In your implementation of
hash(into:)
, don’t callfinalize()
on thehasher
instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher)