Skip to content

Commit 2de97d2

Browse files
committedAug 1, 2024
fix: set onOffValueForStartUp in case of reserved values
1 parent 6dcedbb commit 2de97d2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed
 

‎src/app/clusters/on-off-server/on-off-server.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -556,17 +556,11 @@ Status OnOffServer::getOnOffValueForStartUp(chip::EndpointId endpoint, bool & on
556556
{
557557
app::DataModel::Nullable<OnOff::StartUpOnOffEnum> startUpOnOff;
558558
Status status = Attributes::StartUpOnOff::Get(endpoint, startUpOnOff);
559-
if (status != Status::Success)
560-
{
561-
return status;
562-
}
559+
VerifyOrReturnError(status == Status::Success, status);
563560

564561
bool currentOnOff = false;
565562
status = Attributes::OnOff::Get(endpoint, &currentOnOff);
566-
if (status != Status::Success)
567-
{
568-
return status;
569-
}
563+
VerifyOrReturnError(status == Status::Success, status);
570564

571565
if (startUpOnOff.IsNull() || GetBootReason() == BootReasonType::kSoftwareUpdateCompleted)
572566
{
@@ -587,6 +581,7 @@ Status OnOffServer::getOnOffValueForStartUp(chip::EndpointId endpoint, bool & on
587581
break;
588582
default:
589583
// All other values 0x03- 0xFE are reserved - no action.
584+
onOffValueForStartUp = currentOnOff;
590585
break;
591586
}
592587

0 commit comments

Comments
 (0)