struct DoorLockTraitThis trait provides an interface to a generic way to secure a door.
-
List of the event types that are supported by
DoorLockTrait.Declaration
Swift
static let supportedEventTypes: [any Event.Type] -
List of the commands that are supported by
DoorLockTrait.Declaration
Swift
static let supportedCommandTypes: [any Command.Type] -
The trait identifier.
Declaration
Swift
static let identifier: String -
Metadata about this
Trait.Declaration
Swift
let metadata: TraitMetadata -
List of attributes for the
DoorLockTrait.Declaration
Swift
let attributes: Matter.DoorLockTrait.Attributes -
Creates a new Trait instance using data read from the given
TraitDecoder.Throws
HomeError.parseErrorwhen parsing fails.Declaration
Swift
init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throwsParameters
decoderThe raw data representing this Trait.
interactionProxyProxy to the Interaction Client.
metadataMetadata about this Trait.
-
Writes this object to the given
TraitEncoder. ThrowsHomeError.encodingFailedif 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
HomeErrors thrown by this call.Declaration
Swift
func forceRead() async throws -
Attributes for the
DoorLockTrait.Declaration
Swift
struct Attributes -
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Parameters
lhsA value to compare.
rhsAnother value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashableprotocol. 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 thehasherinstance 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) -
A set of credentials used when operating the door lock.
Declaration
Swift
struct CredentialStruct -
Indicates that there is a critical state on the door lock.
Declaration
Swift
struct DoorLockAlarmEvent -
Indicates that the state of the door has changed.
Declaration
Swift
struct DoorStateChangeEvent -
Indicates that a lock operation has taken place.
Declaration
Swift
struct LockOperationEvent -
Indicates that a lock operation failed.
Declaration
Swift
struct LockOperationErrorEvent -
Indicates that a lock user, schedule, or credential has changed.
Declaration
Swift
struct LockUserChangeEvent -
Whether the device supports the
lockDoorcommand for this trait.Declaration
Swift
var supportsLockDoorCommand: Bool { get } -
Lock the door.
Declaration
Swift
func lockDoor(optionalArgsProvider: ((Matter.DoorLockTrait.LockDoorCommand.OptionalArgs) -> Void)? = nil) async throws -
The batchable version of lockDoor command above.
See also
lockDoorDeclaration
Swift
func lockDoorBatchable(optionalArgsProvider: ((Matter.DoorLockTrait.LockDoorCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Void> -
Whether the device supports the
unlockDoorcommand for this trait.Declaration
Swift
var supportsUnlockDoorCommand: Bool { get } -
Unlock the door.
Declaration
Swift
func unlockDoor(optionalArgsProvider: ((Matter.DoorLockTrait.UnlockDoorCommand.OptionalArgs) -> Void)? = nil) async throws -
The batchable version of unlockDoor command above.
See also
unlockDoorDeclaration
Swift
func unlockDoorBatchable(optionalArgsProvider: ((Matter.DoorLockTrait.UnlockDoorCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Void> -
Whether the device supports the
unlockWithTimeoutcommand for this trait.Declaration
Swift
var supportsUnlockWithTimeoutCommand: Bool { get } -
Unlock the door with a timeout parameter. After the timeout, the door automatically relocks.
Declaration
Swift
func unlockWithTimeout(timeout: UInt16, optionalArgsProvider: ((Matter.DoorLockTrait.UnlockWithTimeoutCommand.OptionalArgs) -> Void)? = nil) async throwsParameters
timeoutThe number of seconds to wait before relocking the door lock.
-
The batchable version of unlockWithTimeout command above.
See also
unlockWithTimeoutDeclaration
Swift
func unlockWithTimeoutBatchable(timeout: UInt16, optionalArgsProvider: ((Matter.DoorLockTrait.UnlockWithTimeoutCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Void> -
Whether the device supports the
setWeekDaySchedulecommand for this trait.Declaration
Swift
var supportsSetWeekDayScheduleCommand: Bool { get } -
Set a weekly repeating schedule for the specified user.
Declaration
Swift
func setWeekDaySchedule(weekDayIndex: UInt8, userIndex: UInt16, daysMask: Matter.DoorLockTrait.DaysMaskMap, startHour: UInt8, startMinute: UInt8, endHour: UInt8, endMinute: UInt8) async throwsParameters
weekDayIndexThe unique identifier for the week day.
userIndexThe unique identifier for the user for whom the repeating schedule is being set.
daysMaskThe days that constitute the repeating schedule. Valid values are defined by
DaysMaskMap.startHourThe start hour of the repeating event.
startMinuteThe start minute of the repeating event.
endHourThe end hour of the repeating event.
endMinuteThe end minute of the repeating event.
-
setWeekDayScheduleBatchable(weekDayIndex:userIndex:daysMask:startHour:startMinute:endHour:endMinute:)
The batchable version of setWeekDaySchedule command above.
See also
setWeekDayScheduleDeclaration
Swift
func setWeekDayScheduleBatchable(weekDayIndex: UInt8, userIndex: UInt16, daysMask: Matter.DoorLockTrait.DaysMaskMap, startHour: UInt8, startMinute: UInt8, endHour: UInt8, endMinute: UInt8) throws -> BatchableCommand<Void> -
Whether the device supports the
getWeekDaySchedulecommand for this trait.Declaration
Swift
var supportsGetWeekDayScheduleCommand: Bool { get } -
Retrieve the weekly schedule for the specified user. Week day schedules are used to restrict access to a specified time window on certain days of the week. The schedule is repeated each week.
Declaration
Swift
func getWeekDaySchedule(weekDayIndex: UInt8, userIndex: UInt16) async throws -> Matter.DoorLockTrait.GetWeekDayScheduleCommandResponseParameters
weekDayIndexThe unique identifier for the week day schedule to retrieve.
userIndexThe unique identifier for the user whose week day schedule is to be retrieved.
Return Value
Returns the weekly repeating schedule data for the specified schedule index.
-
The batchable version of getWeekDaySchedule command above.
See also
getWeekDayScheduleDeclaration
Swift
func getWeekDayScheduleBatchable(weekDayIndex: UInt8, userIndex: UInt16) throws -> BatchableCommand<Matter.DoorLockTrait.GetWeekDayScheduleCommandResponse> -
Whether the device supports the
clearWeekDaySchedulecommand for this trait.Declaration
Swift
var supportsClearWeekDayScheduleCommand: Bool { get } -
Clear the specified week day schedule or all week day schedules for the specific user. Week day schedules are used to restrict access to a specified time window on certain days of the week. The schedule is repeated each week.
Declaration
Swift
func clearWeekDaySchedule(weekDayIndex: UInt8, userIndex: UInt16) async throwsParameters
weekDayIndexThe unique identifier for the week day schedule to clear.
0xFEclears all week day schedules for the specified user.userIndexThe unique identifier for the user whose schedule is to be cleared.
-
The batchable version of clearWeekDaySchedule command above.
See also
clearWeekDayScheduleDeclaration
Swift
func clearWeekDayScheduleBatchable(weekDayIndex: UInt8, userIndex: UInt16) throws -> BatchableCommand<Void> -
Whether the device supports the
setYearDaySchedulecommand for this trait.Declaration
Swift
var supportsSetYearDayScheduleCommand: Bool { get } -
Set a time-specific schedule ID for a specified user.
Declaration
Swift
func setYearDaySchedule(yearDayIndex: UInt8, userIndex: UInt16, localStartTime: UInt32, localEndTime: UInt32) async throwsParameters
yearDayIndexThe unique identifier for the year day schedule.
userIndexThe unique identifier for the user for whom the repeating schedule is being set.
localStartTimeThe starting time for the year day schedule in Epoch Time in seconds with local time offset based on the local timezone and DST offset on the day represented by the value.
localEndTimeThe ending time for the year day schedule in Epoch Time in seconds with local time offset based on the local timezone and DST offset on the day represented by the value.
-
The batchable version of setYearDaySchedule command above.
See also
setYearDayScheduleDeclaration
Swift
func setYearDayScheduleBatchable(yearDayIndex: UInt8, userIndex: UInt16, localStartTime: UInt32, localEndTime: UInt32) throws -> BatchableCommand<Void> -
Whether the device supports the
getYearDaySchedulecommand for this trait.Declaration
Swift
var supportsGetYearDayScheduleCommand: Bool { get } -
Retrieve the specified year day schedule for the specified user. Year day schedules are used to restrict access to a specified date and time window.
Declaration
Swift
func getYearDaySchedule(yearDayIndex: UInt8, userIndex: UInt16) async throws -> Matter.DoorLockTrait.GetYearDayScheduleCommandResponseParameters
yearDayIndexThe unique identifier for the year day schedule to be retrieved.
userIndexThe unique identifier for the user whose year day schedule is to be retrieved.
Return Value
Returns the year day schedule data for the specified schedule and user indexes.
-
The batchable version of getYearDaySchedule command above.
See also
getYearDayScheduleDeclaration
Swift
func getYearDayScheduleBatchable(yearDayIndex: UInt8, userIndex: UInt16) throws -> BatchableCommand<Matter.DoorLockTrait.GetYearDayScheduleCommandResponse> -
Whether the device supports the
clearYearDaySchedulecommand for this trait.Declaration
Swift
var supportsClearYearDayScheduleCommand: Bool { get } -
Clear the specified year day schedule, or all year day schedules for the specific user. Year day schedules are used to restrict access to a specified date and time window.
Declaration
Swift
func clearYearDaySchedule(yearDayIndex: UInt8, userIndex: UInt16) async throwsParameters
yearDayIndexThe unique identifier for the year day schedule to clear.
0xFEclears all year day schedules for the specified user.userIndexThe unique identifier for the user whose year day schedule is to be cleared.
-
The batchable version of clearYearDaySchedule command above.
See also
clearYearDayScheduleDeclaration
Swift
func clearYearDayScheduleBatchable(yearDayIndex: UInt8, userIndex: UInt16) throws -> BatchableCommand<Void> -
Whether the device supports the
setHolidaySchedulecommand for this trait.Declaration
Swift
var supportsSetHolidayScheduleCommand: Bool { get } -
Set the holiday schedule by specifying the local start and end time with respect to a specific lock operating mode.
Declaration
Swift
func setHolidaySchedule(holidayIndex: UInt8, localStartTime: UInt32, localEndTime: UInt32, operatingMode: Matter.DoorLockTrait.OperatingModeEnum) async throwsParameters
holidayIndexThe unique identifier for the holiday whose schedule is to be set.
localStartTimeThe starting time for the holiday schedule in Epoch Time in seconds with local time offset based on the local timezone and DST offset on the day represented by the value.
localEndTimeThe ending time for the holiday schedule in Epoch Time in seconds with local time offset based on the local timezone and DST offset on the day represented by the value.
operatingModeThe operating mode to use for the specified holiday schedule start and end time. Valid values are defined by
OperatingModeEnum. -
The batchable version of setHolidaySchedule command above.
See also
setHolidayScheduleDeclaration
Swift
func setHolidayScheduleBatchable(holidayIndex: UInt8, localStartTime: UInt32, localEndTime: UInt32, operatingMode: Matter.DoorLockTrait.OperatingModeEnum) throws -> BatchableCommand<Void> -
Whether the device supports the
getHolidaySchedulecommand for this trait.Declaration
Swift
var supportsGetHolidayScheduleCommand: Bool { get } -
Get the holiday schedule for the specified holiday index.
Declaration
Swift
func getHolidaySchedule(holidayIndex: UInt8) async throws -> Matter.DoorLockTrait.GetHolidayScheduleCommandResponseParameters
holidayIndexThe unique identifier for the holiday schedule to retrieve.
Return Value
Returns the holiday schedule entry for the specified holiday ID.
-
The batchable version of getHolidaySchedule command above.
See also
getHolidayScheduleDeclaration
Swift
func getHolidayScheduleBatchable(holidayIndex: UInt8) throws -> BatchableCommand<Matter.DoorLockTrait.GetHolidayScheduleCommandResponse> -
Whether the device supports the
clearHolidaySchedulecommand for this trait.Declaration
Swift
var supportsClearHolidayScheduleCommand: Bool { get } -
Clear the specified holiday schedule, or all holiday schedules.
Declaration
Swift
func clearHolidaySchedule(holidayIndex: UInt8) async throwsParameters
holidayIndexThe unique identifier for the holiday schedule to clear.
0xFEclears all holiday schedules. -
The batchable version of clearHolidaySchedule command above.
See also
clearHolidayScheduleDeclaration
Swift
func clearHolidayScheduleBatchable(holidayIndex: UInt8) throws -> BatchableCommand<Void> -
Whether the device supports the
setUsercommand for this trait.Declaration
Swift
var supportsSetUserCommand: Bool { get } -
Set the user on the lock.
Declaration
Swift
func setUser(operationType: Matter.DoorLockTrait.DataOperationTypeEnum, userIndex: UInt16, userName: String?, userUniqueID: UInt32?, userStatus: Matter.DoorLockTrait.UserStatusEnum?, userType: Matter.DoorLockTrait.UserTypeEnum?, credentialRule: Matter.DoorLockTrait.CredentialRuleEnum?) async throwsParameters
operationTypeThe operation to perform. Valid values are defined by
DataOperationTypeEnum.userIndexThe unique identifier for the user to set on the lock.
userNameThe user name of the user to set on the lock.
userStatusThe status of the user to set on the lock. Valid values are defined by
UserStatusEnum.userTypeThe type of the user. Valid values are defined by
UserTypeEnum.credentialRuleThe credential rule. Valid values are defined by
CredentialRuleEnum. -
The batchable version of setUser command above.
See also
setUserDeclaration
Swift
func setUserBatchable(operationType: Matter.DoorLockTrait.DataOperationTypeEnum, userIndex: UInt16, userName: String?, userUniqueID: UInt32?, userStatus: Matter.DoorLockTrait.UserStatusEnum?, userType: Matter.DoorLockTrait.UserTypeEnum?, credentialRule: Matter.DoorLockTrait.CredentialRuleEnum?) throws -> BatchableCommand<Void> -
Whether the device supports the
getUsercommand for this trait.Declaration
Swift
var supportsGetUserCommand: Bool { get } -
Retrieve the user type for a specific user.
Declaration
Swift
func getUser(userIndex: UInt16) async throws -> Matter.DoorLockTrait.GetUserCommandResponseParameters
userIndexThe unique identifier for the user whose type is to be retrieved.
Return Value
Returns the user for the specified
userIndex. -
The batchable version of getUser command above.
See also
getUserDeclaration
Swift
func getUserBatchable(userIndex: UInt16) throws -> BatchableCommand<Matter.DoorLockTrait.GetUserCommandResponse> -
Whether the device supports the
clearUsercommand for this trait.Declaration
Swift
var supportsClearUserCommand: Bool { get } -
Clear the specified user.
Declaration
Swift
func clearUser(userIndex: UInt16) async throwsParameters
userIndexThe unique identifier for the user to clear.
0xFFFEclears all users. -
The batchable version of clearUser command above.
See also
clearUserDeclaration
Swift
func clearUserBatchable(userIndex: UInt16) throws -> BatchableCommand<Void> -
Whether the device supports the
setCredentialcommand for this trait.Declaration
Swift
var supportsSetCredentialCommand: Bool { get } -
Set a credential into the lock for a new or existing user, or for a programming user.
Declaration
Swift
func setCredential(operationType: Matter.DoorLockTrait.DataOperationTypeEnum, credential: Matter.DoorLockTrait.CredentialStruct, credentialData: Data, userIndex: UInt16?, userStatus: Matter.DoorLockTrait.UserStatusEnum?, userType: Matter.DoorLockTrait.UserTypeEnum?) async throws -> Matter.DoorLockTrait.SetCredentialCommandResponseParameters
operationTypeThe operation to be performed.
credentialThe credential to be set.
credentialDataThe credential data to set for the credential being added or modified.
userIndexThe unique identifier for the user record that corresponds to the credential being added or modified.
userStatusThe user status to use in the new user record if a new user is being created. Valid values are defined by
UserStatusEnum.userTypeThe user type to use in the new user record if a new user is being created. Valid values are defined by
UserTypeEnum.Return Value
The status for setting the specified credential.
-
The batchable version of setCredential command above.
See also
setCredentialDeclaration
Swift
func setCredentialBatchable(operationType: Matter.DoorLockTrait.DataOperationTypeEnum, credential: Matter.DoorLockTrait.CredentialStruct, credentialData: Data, userIndex: UInt16?, userStatus: Matter.DoorLockTrait.UserStatusEnum?, userType: Matter.DoorLockTrait.UserTypeEnum?) throws -> BatchableCommand<Matter.DoorLockTrait.SetCredentialCommandResponse> -
Whether the device supports the
getCredentialStatuscommand for this trait.Declaration
Swift
var supportsGetCredentialStatusCommand: Bool { get } -
Retrieve the status of the specified credential.
Declaration
Swift
func getCredentialStatus(credential: Matter.DoorLockTrait.CredentialStruct) async throws -> Matter.DoorLockTrait.GetCredentialStatusCommandResponseParameters
credentialThe credential whose status is to be retrieved.
Return Value
Returns the status for the specified credential.
-
The batchable version of getCredentialStatus command above.
See also
getCredentialStatusDeclaration
Swift
func getCredentialStatusBatchable(credential: Matter.DoorLockTrait.CredentialStruct) throws -> BatchableCommand<Matter.DoorLockTrait.GetCredentialStatusCommandResponse> -
Whether the device supports the
clearCredentialcommand for this trait.Declaration
Swift
var supportsClearCredentialCommand: Bool { get } -
Clear a single credential, one type of credential, or all credentials except
ProgrammingPINcredentials.Declaration
Swift
func clearCredential(credential: Matter.DoorLockTrait.CredentialStruct?) async throwsParameters
credentialThe credential to be cleared.
-
The batchable version of clearCredential command above.
See also
clearCredentialDeclaration
Swift
func clearCredentialBatchable(credential: Matter.DoorLockTrait.CredentialStruct?) throws -> BatchableCommand<Void> -
Whether the device supports the
unboltDoorcommand for this trait.Declaration
Swift
var supportsUnboltDoorCommand: Bool { get } -
Disengage the deadbolt.
Declaration
Swift
func unboltDoor(optionalArgsProvider: ((Matter.DoorLockTrait.UnboltDoorCommand.OptionalArgs) -> Void)? = nil) async throws -
The batchable version of unboltDoor command above.
See also
unboltDoorDeclaration
Swift
func unboltDoorBatchable(optionalArgsProvider: ((Matter.DoorLockTrait.UnboltDoorCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Void> -
Whether the device supports the
setAliroReaderConfigcommand for this trait.Declaration
Swift
var supportsSetAliroReaderConfigCommand: Bool { get } -
The batchable version of setAliroReaderConfig command above.
See also
setAliroReaderConfigDeclaration
Swift
func setAliroReaderConfigBatchable(signingKey: Data, verificationKey: Data, groupIdentifier: Data, optionalArgsProvider: ((Matter.DoorLockTrait.SetAliroReaderConfigCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Void> -
Whether the device supports the
clearAliroReaderConfigcommand for this trait.Declaration
Swift
var supportsClearAliroReaderConfigCommand: Bool { get } -
The batchable version of clearAliroReaderConfig command above.
See also
clearAliroReaderConfigDeclaration
Swift
func clearAliroReaderConfigBatchable() throws -> BatchableCommand<Void> -
Alarm codes.
Declaration
Swift
enum AlarmCodeEnum -
Indicates the credential rule that can be applied to a particular user.
Declaration
Swift
enum CredentialRuleEnum -
Indicates the credential type.
Declaration
Swift
enum CredentialTypeEnum -
Indicates the data operation performed.
Declaration
Swift
enum DataOperationTypeEnum -
Door lock states.
Declaration
Swift
enum DlLockState -
Lock types.
Declaration
Swift
enum DlLockType -
Door lock statuses.
Declaration
Swift
enum DlStatus -
Door lock operation event codes.
Declaration
Swift
enum DoorLockOperationEventCode -
Door lock programming event codes.
Declaration
Swift
enum DoorLockProgrammingEventCode -
Door lock credential status.
Declaration
Swift
enum DoorLockSetPinOrIdStatus -
The status for a specific user.
Declaration
Swift
enum DoorLockUserStatus -
The type for a specific user.
Declaration
Swift
enum DoorLockUserType -
Door states.
Declaration
Swift
enum DoorStateEnum -
Data types associated with door locks.
Declaration
Swift
enum LockDataTypeEnum -
The type of Lock operation performed.
Declaration
Swift
enum LockOperationTypeEnum -
Operating modes.
Declaration
Swift
enum OperatingModeEnum -
Indicates the cause of the Lock or Unlock operation failure.
Declaration
Swift
enum OperationErrorEnum -
Indicates the source of the Lock or Unlock operation.
Declaration
Swift
enum OperationSourceEnum -
The status for a specific user.
Declaration
Swift
enum UserStatusEnum -
The type of a specific user.
Declaration
Swift
enum UserTypeEnum -
The days of the week.
Declaration
Swift
struct DaysMaskMap -
Credential rules.
Declaration
Swift
struct DlCredentialRuleMask -
Credential rules.
Declaration
Swift
struct DlCredentialRulesSupport -
The default configurations as they are physically set on the device.
Declaration
Swift
struct DlDefaultConfigurationRegister -
Event mask used to enable and disable the transmission of keypad operation events.
Declaration
Swift
struct DlKeypadOperationEventMask -
Event mask used to enable and disable keypad programming events. Only applied to the Programming Event Notification Command.
Declaration
Swift
struct DlKeypadProgrammingEventMask -
The local programming features that are disabled when the
enableLocalProgrammingattribute is set tofalse.Declaration
Swift
struct DlLocalProgrammingFeatures -
Manual operation events.
Declaration
Swift
struct DlManualOperationEventMask -
Event mask used to enable and disable the transmission of RFID events.
Declaration
Swift
struct DlRfidOperationEventMask -
Event mask used to enable and disable RFID programming events.
Declaration
Swift
struct DlRfidProgrammingEventMask -
Event mask used to enable and disable the transmission of remote operation events.
Declaration
Swift
struct DlRemoteOperationEventMask -
Event mask used to enable and disable remote programming events.
Declaration
Swift
struct DlRemoteProgrammingEventMask -
This bitmap contains all operating bits of the Operating Mode Attribute supported by the lock.
Declaration
Swift
struct DlSupportedOperatingModes -
Days of the week.
Declaration
Swift
struct DoorLockDayOfWeek -
DoorLock cluster FeatureMap. Some behaviors of these features are described in the cluster attributes and commands. For complete details of these features, see the Matter Specification.
Declaration
Swift
struct Feature