From 1092182d72e3d6c7a5b0e92f21c5daa0741cc1e1 Mon Sep 17 00:00:00 2001 From: Timothy Maes Date: Fri, 25 Jun 2021 21:59:56 +0200 Subject: [PATCH] Level cluster Step/Move commands reverted to random value after transition (#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 Co-authored-by: Boris Zbarsky --- src/app/clusters/level-control/level-control.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 6f4c427367222a..88bfc009fe7f47 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -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; @@ -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;