Skip to content

Commit 04dbb37

Browse files
committed
samples: matter: lock: Remove Lock/Unlock from callback
Remove redundant call to `BoltLockManager::[Lock|Unlock]` from MatterPostAttributeChangeCallback. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 4782d4a commit 04dbb37

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

samples/matter/lock/src/zcl_callbacks.cpp

+1-13
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &a
2525
{
2626
VerifyOrReturn(attributePath.mClusterId == DoorLock::Id);
2727

28-
if (attributePath.mAttributeId == DoorLock::Attributes::LockState::Id) {
29-
/* Post events only if current lock state is different than given */
30-
switch (*value) {
31-
case to_underlying(DlLockState::kLocked):
32-
BoltLockMgr().Lock(BoltLockManager::OperationSource::kRemote);
33-
break;
34-
case to_underlying(DlLockState::kUnlocked):
35-
BoltLockMgr().Unlock(BoltLockManager::OperationSource::kRemote);
36-
break;
37-
default:
38-
break;
39-
}
40-
} else if (attributePath.mAttributeId == DoorLock::Attributes::RequirePINforRemoteOperation::Id) {
28+
if (attributePath.mAttributeId == DoorLock::Attributes::RequirePINforRemoteOperation::Id) {
4129
BoltLockMgr().SetRequirePIN(*value);
4230
}
4331
}

0 commit comments

Comments
 (0)