Skip to content

Commit

Permalink
Level cluster Step/Move commands reverted to random value after trans…
Browse files Browse the repository at this point in the history
…ition (#7879)

* Level cluster Step/Move commands reverted to random value after finishing transition.
Fixed by adding fill-in of unused 'storedLevel' for these commands.

* Update src/app/clusters/level-control/level-control.cpp

typo fix

Co-authored-by: Boris Zbarsky <[email protected]>

Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Aug 16, 2021
1 parent 09e686c commit 1051132
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ static void moveHandler(CommandId commandId, uint8_t moveMode, uint8_t rate, uin
// OnLevel is not used for Move commands.
state->useOnLevel = false;

// storedLevel is not used for Move commands.
state->storedLevel = INVALID_STORED_LEVEL;

// The setup was successful, so mark the new state as active and return.
schedule(endpoint, state->eventDurationMs);
status = EMBER_ZCL_STATUS_SUCCESS;
Expand Down Expand Up @@ -826,6 +829,9 @@ static void stepHandler(CommandId commandId, uint8_t stepMode, uint8_t stepSize,
// OnLevel is not used for Step commands.
state->useOnLevel = false;

// storedLevel is not used for Step commands
state->storedLevel = INVALID_STORED_LEVEL;

// The setup was successful, so mark the new state as active and return.
schedule(endpoint, state->eventDurationMs);
status = EMBER_ZCL_STATUS_SUCCESS;
Expand Down

0 comments on commit 1051132

Please sign in to comment.