From 100083196dc2932dda9e80727163451659b058e8 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Thu, 9 Mar 2023 20:41:02 -0500 Subject: [PATCH] Step mode Stop doesn't exist. return error on a stepmode =0 (#25592) --- .../color-control-server.cpp | 24 +++---------------- .../color-control-server.h | 1 - 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 72c26f0457b076..d862a11686a34d 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -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; @@ -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) { @@ -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; @@ -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); @@ -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; @@ -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); diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 792d504e8dca73..677a911067d020 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -76,7 +76,6 @@ class ColorControlServer enum StepMode { - STEP_MODE_STOP = 0x00, STEP_MODE_UP = 0x01, STEP_MODE_DOWN = 0x03 };