Skip to content

Commit

Permalink
Step mode Stop doesn't exist. return error on a stepmode =0 (#25592)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs authored and pull[bot] committed Jan 12, 2024
1 parent 4abf80c commit 1638617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
24 changes: 3 additions & 21 deletions src/app/clusters/color-control-server/color-control-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const
VerifyOrExit(colorHueTransitionState != nullptr, status = Status::UnsupportedEndpoint);

// Confirm validity of the step mode received
if (stepMode != STEP_MODE_STOP && stepMode != STEP_MODE_UP && stepMode != STEP_MODE_DOWN)
if (stepMode != STEP_MODE_UP && stepMode != STEP_MODE_DOWN)
{
commandObj->AddStatus(commandPath, Status::InvalidCommand);
return true;
Expand All @@ -1200,12 +1200,6 @@ bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const
// New command. Need to stop any active transitions.
stopAllColorTransitions(endpoint);

if (stepMode == STEP_MODE_STOP)
{
commandObj->AddStatus(commandPath, Status::Success);
return true;
}

// Handle color mode transition, if necessary.
if (isEnhanced)
{
Expand Down Expand Up @@ -1420,7 +1414,7 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj,
VerifyOrExit(colorSaturationTransitionState != nullptr, status = Status::UnsupportedEndpoint);

// Confirm validity of the step mode received
if (stepMode != STEP_MODE_STOP && stepMode != STEP_MODE_UP && stepMode != STEP_MODE_DOWN)
if (stepMode != STEP_MODE_UP && stepMode != STEP_MODE_DOWN)
{
commandObj->AddStatus(commandPath, Status::InvalidCommand);
return true;
Expand All @@ -1440,12 +1434,6 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj,
// New command. Need to stop any active transitions.
stopAllColorTransitions(endpoint);

if (stepMode == MOVE_MODE_STOP)
{
commandObj->AddStatus(commandPath, Status::Success);
return true;
}

// Handle color mode transition, if necessary.
handleModeSwitch(endpoint, COLOR_MODE_HSV);

Expand Down Expand Up @@ -2354,7 +2342,7 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj,
VerifyOrExit(colorTempTransitionState != nullptr, status = Status::UnsupportedEndpoint);

// Confirm validity of the step mode received
if (stepMode != STEP_MODE_STOP && stepMode != STEP_MODE_UP && stepMode != STEP_MODE_DOWN)
if (stepMode != STEP_MODE_UP && stepMode != STEP_MODE_DOWN)
{
commandObj->AddStatus(commandPath, Status::InvalidCommand);
return true;
Expand All @@ -2369,12 +2357,6 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj,
// New command. Need to stop any active transitions.
stopAllColorTransitions(endpoint);

if (stepMode == MOVE_MODE_STOP)
{
commandObj->AddStatus(commandPath, Status::Success);
return true;
}

Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class ColorControlServer

enum StepMode
{
STEP_MODE_STOP = 0x00,
STEP_MODE_UP = 0x01,
STEP_MODE_DOWN = 0x03
};
Expand Down

0 comments on commit 1638617

Please sign in to comment.