Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ColorControl] Step mode Stop doesn't exist. return error on a stepmode = 0 #25592

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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