struct ThermostatTrait
This trait provides an interface to the functionality of a thermostat.
-
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
.Parameters
lhs
A value to compare.
rhs
Another value to compare.
-
Unit of measurement used for the AC capacity.
Declaration
Swift
enum ACCapacityFormatEnum
-
Types of compressor.
Declaration
Swift
enum ACCompressorTypeEnum
-
The positions a louver may be in.
Declaration
Swift
enum ACLouverPositionEnum
-
Types of refrigerant.
Declaration
Swift
enum ACRefrigerantTypeEnum
-
Types of Air Conditioner features.
Declaration
Swift
enum ACTypeEnum
-
Types of atomic requests.
Declaration
Swift
enum AtomicRequestTypeEnum
-
Attributes for the
ThermostatTrait
.Declaration
Swift
struct Attributes
-
The system modes that the thermostat can operate in.
Declaration
Swift
enum ControlSequenceOfOperationEnum
-
Thermostat cluster FeatureMap.
Declaration
Swift
struct Feature
-
Describes the characteristics of the HVAC system.
Declaration
Swift
struct HvacSystemTypeBitmap
-
Indicates the sensed occupancy state.
Declaration
Swift
struct OccupancyBitmap
-
Preset Scenarios.
Declaration
Swift
enum PresetScenarioEnum
-
A preset.
Declaration
Swift
struct PresetStruct
-
Preset type features.
Declaration
Swift
struct PresetTypeFeaturesBitmap
-
A preset type.
Declaration
Swift
struct PresetTypeStruct
-
Thermostat programming operational states.
Declaration
Swift
struct ProgrammingOperationModeBitmap
-
Thermostate running states.
Declaration
Swift
struct RelayStateBitmap
-
Remote sensing configurations.
Declaration
Swift
struct RemoteSensingBitmap
-
Days of the week for scheduling.
Declaration
Swift
struct ScheduleDayOfWeekBitmap
-
How the app decodes the setpoint fields of each transition.
Declaration
Swift
struct ScheduleModeBitmap
-
A schedule.
Declaration
Swift
struct ScheduleStruct
-
A schedule transition.
Declaration
Swift
struct ScheduleTransitionStruct
-
Features that may be supported by a Thermostat schedule.
Declaration
Swift
struct ScheduleTypeFeaturesBitmap
-
A schedule type.
Declaration
Swift
struct ScheduleTypeStruct
-
Possible sources of a given setpoint.
Declaration
Swift
enum SetpointChangeSourceEnum
-
Specifies which setpoint is to be adjusted.
Declaration
Swift
enum SetpointRaiseLowerModeEnum
-
Days of the week that may be designated the first day of the week.
Declaration
Swift
enum StartOfWeekEnum
-
The current operating mode of the thermostat.
Declaration
Swift
enum SystemModeEnum
-
Temperature setpoint hold statuses.
Declaration
Swift
enum TemperatureSetpointHoldEnum
-
The running mode of the thermostat. Intended to provide additional information when the thermostat is in auto mode.
Declaration
Swift
enum ThermostatRunningModeEnum
-
A single transition in a thermostat schedule.
Declaration
Swift
struct WeeklyScheduleTransitionStruct
-
Begin, commit, or cancel an atomic write.
Declaration
Swift
func atomicRequest(requestType: Matter.ThermostatTrait.AtomicRequestTypeEnum, attributeRequests: [UInt32], optionalArgsProvider: ((Matter.ThermostatTrait.AtomicRequestCommand.OptionalArgs) -> Void)? = nil) async throws -> Matter.ThermostatTrait.AtomicRequestCommandResponse
-
The batchable version of atomicRequest command above.
See also
atomicRequestDeclaration
Swift
func atomicRequestBatchable(requestType: Matter.ThermostatTrait.AtomicRequestTypeEnum, attributeRequests: [UInt32], optionalArgsProvider: ((Matter.ThermostatTrait.AtomicRequestCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Matter.ThermostatTrait.AtomicRequestCommandResponse>
-
List of attributes for the
ThermostatTrait
.Declaration
Swift
let attributes: Matter.ThermostatTrait.Attributes
-
This method is deprecated in the Matter specification and is not supported.
Declaration
Swift
func clearWeeklySchedule() async throws
-
The batchable version of clearWeeklySchedule command above.
See also
clearWeeklyScheduleDeclaration
Swift
func clearWeeklyScheduleBatchable() throws -> BatchableCommand<Void>
-
Writes this object to the given
TraitEncoder
. ThrowsHomeError.encodingFailed
if the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws
-
This API provides the ability to invalidate state retrieved through subscriptions to the target device in the cases where state is not being reported correctly, either intentionally (e.g attributes in Matter traits with the “C” quality) or unintentionally due to poor implementations.
When successful, this API will result in a forced read of the convening scope as specified by the sub-class and return the result through existing Trait subscriptions if present and active.
This API is to be used sparingly as it can impact the performance and battery life of the target device. As such, this API may be throttled by the platform. Callers SHALL be prepared to deal with
HomeError
s thrown by this call.Declaration
Swift
func forceRead() async throws
-
This method is deprecated in the Matter specification and is not supported.
Declaration
Swift
func getWeeklySchedule(daysToReturn: Matter.ThermostatTrait.ScheduleDayOfWeekBitmap, modeToReturn: Matter.ThermostatTrait.ScheduleModeBitmap) async throws -> Matter.ThermostatTrait.GetWeeklyScheduleCommandResponse
Parameters
daysToReturn
The number of days the client would like to return the set point values for. It can be any combination of single days or the entire week.
modeToReturn
Indicates the mode the client would like to return the set point values for. It can be any combination of modes.
Return Value
The weekly schedule, with the same payload as
setWeeklySchedule
. -
The batchable version of getWeeklySchedule command above.
See also
getWeeklyScheduleDeclaration
Swift
func getWeeklyScheduleBatchable(daysToReturn: Matter.ThermostatTrait.ScheduleDayOfWeekBitmap, modeToReturn: Matter.ThermostatTrait.ScheduleModeBitmap) throws -> BatchableCommand<Matter.ThermostatTrait.GetWeeklyScheduleCommandResponse>
-
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)
-
The trait identifier.
Declaration
Swift
static let identifier: String
-
Creates a new Trait instance using data read from the given
TraitDecoder
.Throws
HomeError.parseError
when parsing fails.Declaration
Swift
init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throws
Parameters
decoder
The raw data representing this Trait.
interactionProxy
Proxy to the Interaction Client.
metadata
Metadata about this Trait.
-
Metadata about this
Trait
.Declaration
Swift
let metadata: TraitMetadata
-
The batchable version of setActivePresetRequest command above.
See also
setActivePresetRequestDeclaration
Swift
func setActivePresetRequestBatchable(presetHandle: Data?) throws -> BatchableCommand<Void>
-
The batchable version of setActiveScheduleRequest command above.
See also
setActiveScheduleRequestDeclaration
Swift
func setActiveScheduleRequestBatchable(scheduleHandle: Data) throws -> BatchableCommand<Void>
-
This method is deprecated in the Matter specification and is not supported.
Declaration
Swift
func setWeeklySchedule(numberOfTransitionsForSequence: UInt8, dayOfWeekForSequence: Matter.ThermostatTrait.ScheduleDayOfWeekBitmap, modeForSequence: Matter.ThermostatTrait.ScheduleModeBitmap, transitions: [Matter.ThermostatTrait.WeeklyScheduleTransitionStruct]) async throws
Parameters
numberOfTransitionsForSequence
The number of individual transitions to expect for this sequence of commands.
dayOfWeekForSequence
The day(s) of the week to which all the transitions within the payload of the command should be associated. The bitmap values conform to those defined in
ScheduleDayOfWeekBitmap
.modeForSequence
How the app decodes the
coolSetpoint
andheatSetpoint
fields of each transition. The bitmap values confirm to those defined inScheduleModeBitmap
.transitions
The list of setpoint transitions used to update the specified daily schedules. Each setpoint transition is represented by a
WeeklyScheduleTransitionStruct
. -
setWeeklyScheduleBatchable(numberOfTransitionsForSequence:dayOfWeekForSequence:modeForSequence:transitions:)
The batchable version of setWeeklySchedule command above.
See also
setWeeklyScheduleDeclaration
Swift
func setWeeklyScheduleBatchable(numberOfTransitionsForSequence: UInt8, dayOfWeekForSequence: Matter.ThermostatTrait.ScheduleDayOfWeekBitmap, modeForSequence: Matter.ThermostatTrait.ScheduleModeBitmap, transitions: [Matter.ThermostatTrait.WeeklyScheduleTransitionStruct]) throws -> BatchableCommand<Void>
-
Change the setpoint for the current thermostat mode.
Declaration
Swift
func setpointRaiseLower(mode: Matter.ThermostatTrait.SetpointRaiseLowerModeEnum, amount: Int8) async throws
Parameters
mode
The setpoint(s) to be adjusted. Valid values are defined by
SetpointRaiseLowerModeEnum
.amount
The amount (possibly negative) that should be added to the setpoint(s), in steps of 0.1°C.
-
The batchable version of setpointRaiseLower command above.
See also
setpointRaiseLowerDeclaration
Swift
func setpointRaiseLowerBatchable(mode: Matter.ThermostatTrait.SetpointRaiseLowerModeEnum, amount: Int8) throws -> BatchableCommand<Void>
-
List of the commands that are supported by
ThermostatTrait
.Declaration
Swift
static let supportedCommandTypes: [any Command.Type]
-
No supported events for
ThermostatTrait
.Declaration
Swift
static let supportedEventTypes: [any Event.Type]
-
Whether the device supports the
atomicRequest
command for this trait.Declaration
Swift
var supportsAtomicRequestCommand: Bool { get }
-
Whether the device supports the
clearWeeklySchedule
command for this trait.Declaration
Swift
var supportsClearWeeklyScheduleCommand: Bool { get }
-
Whether the device supports the
getWeeklySchedule
command for this trait.Declaration
Swift
var supportsGetWeeklyScheduleCommand: Bool { get }
-
Whether the device supports the
setActivePresetRequest
command for this trait.Declaration
Swift
var supportsSetActivePresetRequestCommand: Bool { get }
-
Whether the device supports the
setActiveScheduleRequest
command for this trait.Declaration
Swift
var supportsSetActiveScheduleRequestCommand: Bool { get }
-
Whether the device supports the
setWeeklySchedule
command for this trait.Declaration
Swift
var supportsSetWeeklyScheduleCommand: Bool { get }
-
Whether the device supports the
setpointRaiseLower
command for this trait.Declaration
Swift
var supportsSetpointRaiseLowerCommand: Bool { get }