@@ -491,7 +491,15 @@ bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, c
491
491
EndpointId endpoint = commandPath.mEndpointId ;
492
492
Status status = Status::Success;
493
493
494
- if (shouldExecuteIfOff (endpoint, optionsMask, optionsOverride))
494
+ // StopMoveStep command has no effect on an active color loop.
495
+ // Fetch if it is supported and active.
496
+ uint8_t isColorLoopActive = 0 ;
497
+ if (ColorControlServer::Instance ().HasFeature (endpoint, ColorControlServer::Feature::kColorLoop ))
498
+ {
499
+ Attributes::ColorLoopActive::Get (endpoint, &isColorLoopActive);
500
+ }
501
+
502
+ if (shouldExecuteIfOff (endpoint, optionsMask, optionsOverride) && !isColorLoopActive)
495
503
{
496
504
status = stopAllColorTransitions (endpoint);
497
505
@@ -1165,7 +1173,7 @@ bool ColorControlServer::computeNewHueValue(ColorControlServer::ColorHueTransiti
1165
1173
return true ;
1166
1174
}
1167
1175
1168
- // Check if we are in a color loop. If not, we are in a moveHue
1176
+ // Check if we are in a color loop. If not, we are in a moveHue
1169
1177
uint8_t isColorLoop = 0 ;
1170
1178
Attributes::ColorLoopActive::Get (p->endpoint , &isColorLoop);
1171
1179
@@ -2265,12 +2273,6 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons
2265
2273
VerifyOrExit (colorXTransitionState != nullptr , status = Status::UnsupportedEndpoint);
2266
2274
VerifyOrExit (colorYTransitionState != nullptr , status = Status::UnsupportedEndpoint);
2267
2275
2268
- if (rateX == 0 && rateY == 0 )
2269
- {
2270
- commandObj->AddStatus (commandPath, Status::InvalidCommand);
2271
- return true ;
2272
- }
2273
-
2274
2276
if (!shouldExecuteIfOff (endpoint, optionsMask, optionsOverride))
2275
2277
{
2276
2278
commandObj->AddStatus (commandPath, Status::Success);
@@ -2283,6 +2285,13 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons
2283
2285
// New command. Need to stop any active transitions.
2284
2286
stopAllColorTransitions (endpoint);
2285
2287
2288
+ if (rateX == 0 && rateY == 0 )
2289
+ {
2290
+ // any current transition has been stopped. We are done.
2291
+ commandObj->AddStatus (commandPath, Status::Success);
2292
+ return true ;
2293
+ }
2294
+
2286
2295
// Handle color mode transition, if necessary.
2287
2296
handleModeSwitch (endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY );
2288
2297
0 commit comments