From 733724378bd7805eb6af0716224bf86b460c35eb Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Tue, 7 Nov 2023 16:31:08 -0500 Subject: [PATCH] Unsupported Attribute in UpdateLastConfiguredBy no longer causes commands to fail --- src/app/clusters/scenes-server/scenes-server.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index 08f92596757309..9b3fd1b7594edb 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -80,17 +80,21 @@ template CHIP_ERROR UpdateLastConfiguredBy(HandlerContext & ctx, ResponseType resp) { Access::SubjectDescriptor descriptor = ctx.mCommandHandler.GetSubjectDescriptor(); + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + if (AuthMode::kCase == descriptor.authMode) { + status = Attributes::LastConfiguredBy::Set(ctx.mRequestPath.mEndpointId, descriptor.subject); ReturnErrorOnFailure( AddResponseOnError(ctx, resp, Attributes::LastConfiguredBy::Set(ctx.mRequestPath.mEndpointId, descriptor.subject))); } else { - ReturnErrorOnFailure(AddResponseOnError(ctx, resp, Attributes::LastConfiguredBy::SetNull(ctx.mRequestPath.mEndpointId))); + status = Attributes::LastConfiguredBy::SetNull(ctx.mRequestPath.mEndpointId); } - return CHIP_NO_ERROR; + VerifyOrReturnValue((EMBER_ZCL_STATUS_SUCCESS == status || EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT == status), CHIP_NO_ERROR); + return AddResponseOnError(ctx, resp, status); } ScenesServer ScenesServer::mInstance;