-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix LevelControl Move when no motion requested (#32539) #32993
Fix LevelControl Move when no motion requested (#32539) #32993
Conversation
* Fix LevelControl Move when no motion requested - rate == 0 means "do not move", so handle it more efficiently without moving. Testing done: - Added an integration test for the behavior. Co-authored-by: volodymyr-zvarun-globallogic <Zvarun.V@vizio.com> * Restyled by prettier-yaml --------- Co-authored-by: volodymyr-zvarun-globallogic <Zvarun.V@vizio.com> Co-authored-by: Restyled.io <commits@restyled.io>
PR #32993: Size comparison from 28b2a03 to 97d435b Increases (38 builds for bl602, bl702, bl702l, cc13x4_26x4, cyw30739, efr32, esp32, k32w, linux, nrfconnect, psoc6, qpg, stm32, telink)
Decreases (1 build for efr32)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
@@ -958,6 +960,14 @@ static void moveHandler(app::CommandHandler * commandObj, const app::ConcreteCom | |||
goto send_default_response; | |||
} | |||
|
|||
if (!rate.IsNull() && (rate.Value() == 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cecille Even if merged already ... is this really the right place?
There is another second case for a comparable check for the defaultRate fallback which is way later in the code flow https://github.com/cecille/connectedhomeip/blob/97d435b8a498fc935f04f16743c657f2b660f04b/src/app/clusters/level-control/level-control.cpp#L1042 ... when I understood the code right now "rate===0" would not cause "withOnOff" cases to turn on/off with this logic, but a defaultRate === 0 would ... so that's a different behavior for "Kind of the same". Was that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Apollon77 I believe you are right. Both rate =0 or DefaultRate = 0 when rate is Null should lead to no action taken.
I think a small correction would be to evaluate the rate is Null and DefaultRate > 0 earlier in the handler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmartinez-silabs Thank you for your check. One question for detail: "No action taken at all"? or "Do nothing but process potential onoff logic/set minLevel"?
Case level is 50% and onoff=off ... should be a call here leave onoff===off or turn on as onoff cluster dependency logic would require it.
I ask because this for "rate === 0" was added here in the tests ... so would also need to be adjusted accordingly.
The best "non breaking" change would be to handle defaultRate === null and rate === null the same ... so wouldbe more "move the handling down in the code flow", or!?
Testing done: