-
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
[LevelControl] Implemented the Q quality logic for the CurrentLevel a… #34488
[LevelControl] Implemented the Q quality logic for the CurrentLevel a… #34488
Conversation
…nd RemainingTime attributes
PR #34488: Size comparison from c88d5cf to 494c705 Increases above 0.2%:
Full report (49 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, mbed, nxp, psoc6, qpg, stm32, tizen)
|
PR #34488: Size comparison from c88d5cf to c09be5f Increases above 0.2%:
Full report (82 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nxp, psoc6, qpg, stm32, telink, tizen)
|
/* | ||
* @brief | ||
* This function is used to update the current level attribute | ||
* while respecting it's defined quiet reporting quality: |
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.
"its"
* - At the end of the movement/transition, or | ||
* - When it changes from null to any other value and vice versa. | ||
* | ||
* @param endpoint: endpoint on which the currentLevel attribute must be updated. |
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.
"CurrentLevel", not "currentLevel".
|
||
if (dirtyState == AttributeDirtyState::kMustReport) | ||
{ | ||
markDirty = MarkAttributeDirty::kIfChanged; |
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.
Are we guaranteed that we can't have isStartOrEndOfTransition
true, the value not changing, and reporting needing to be triggered?
Also, why is markDirty declared all the way at the start of the function?
} | ||
|
||
Attributes::RemainingTime::Set(endpoint, state->quietRemainingTime.value().ValueOr(0), markDirty); |
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.
Why the ValueOr(0)
? We just set it to a non-null value, so why is this not just Value()
?
goto send_default_response; | ||
} | ||
|
||
// Cancel any currently active command. | ||
cancelEndpointTimerCallback(endpoint); | ||
SetCurrentLevelQuietReport(endpoint, state, state->quietCurrentLevel.value(), true /*isStartOrEndOfTransition*/); |
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.
So this one is a bit complicated: if we are in fact at start of transition, but the the current value of quietCurrentLevel has not been reported, then we should in fact report here (right?), and I don't think we will given the code above.
It looks like we need a MarkAttributeDirty::kYes value, probably?
project-chip#34488) * Implemented the Quiete reporting quality logic for the CurrentLevel and RemainingTime attributes * Restyled by clang-format * use c++ struct rather than c struct format * add cluster-building-blocks to the data model public dep --------- Co-authored-by: Restyled.io <[email protected]>
* Add WHM to the all clusters app * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Fix CI test * Address review comments from JamesH * Address review comments from JamesH * Address review comments from JamesH * Restyled by clang-format * Get tests passing again * Restyled by clang-format * Declare some global items for future testing (#34509) Co-authored-by: Andrei Litvin <[email protected]> * [LevelControl] Implemented the Q quality logic for the CurrentLevel a… (#34488) * Implemented the Quiete reporting quality logic for the CurrentLevel and RemainingTime attributes * Restyled by clang-format * use c++ struct rather than c struct format * add cluster-building-blocks to the data model public dep --------- Co-authored-by: Restyled.io <[email protected]> * Revert thermostat stuff breaking tot (#34518) * Revert "update tests and thermostat server cluster for new constraints for LocalTemperatureCalibration and MinSetpointDeadBand (#34474)" This reverts commit 335ac96. * Revert "update constraints for LocalTemperatureCalibration and MinSetpointDeadBand attributes (#34473)" This reverts commit 21a5bd6. * [Telink] Update Docker image (Zephyr update) (#34503) * Add TransportPayloadCapability flag for GetConnectedDevices and bubble (#34450) up the flag to the wrapper IM Python APIs. Add python script binding methods for LargePayload tests --to check if session allows large payload. --to close the underlying TCP connection. --to check if the session is active. * Remove no-longer-used MTRDevice logic for truncating data version lists (#34183) * Remove no-longer-used MTRDevice logic for truncating data version lists After #34111, ReadClient handles this logic itself, so the attempted truncation in MTRDevice was now dead code. * Address review comment. * Fix compile issues. * Address another review comment. * Address review comment. * Address review comments by JamesH * Remove unnecessary include file * Address further review comments from JamhesH * Restyled by whitespace * Restyled by clang-format * Address further review comments from JamesH * Address further review comments from JamesH * Update examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Undo suggested change from Boris as idx needed in the loop * Update examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp Co-authored-by: lpbeliveau-silabs <[email protected]> * Address review comments --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Junior Martinez <[email protected]> Co-authored-by: C Freeman <[email protected]> Co-authored-by: Alex Tsitsiura <[email protected]> Co-authored-by: Pradip De <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: jamesharrow <[email protected]> Co-authored-by: lpbeliveau-silabs <[email protected]>
project-chip#34488) * Implemented the Quiete reporting quality logic for the CurrentLevel and RemainingTime attributes * Restyled by clang-format * use c++ struct rather than c struct format * add cluster-building-blocks to the data model public dep --------- Co-authored-by: Restyled.io <[email protected]>
* Add WHM to the all clusters app * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Fix CI test * Address review comments from JamesH * Address review comments from JamesH * Address review comments from JamesH * Restyled by clang-format * Get tests passing again * Restyled by clang-format * Declare some global items for future testing (project-chip#34509) Co-authored-by: Andrei Litvin <[email protected]> * [LevelControl] Implemented the Q quality logic for the CurrentLevel a… (project-chip#34488) * Implemented the Quiete reporting quality logic for the CurrentLevel and RemainingTime attributes * Restyled by clang-format * use c++ struct rather than c struct format * add cluster-building-blocks to the data model public dep --------- Co-authored-by: Restyled.io <[email protected]> * Revert thermostat stuff breaking tot (project-chip#34518) * Revert "update tests and thermostat server cluster for new constraints for LocalTemperatureCalibration and MinSetpointDeadBand (project-chip#34474)" This reverts commit 335ac96. * Revert "update constraints for LocalTemperatureCalibration and MinSetpointDeadBand attributes (project-chip#34473)" This reverts commit 21a5bd6. * [Telink] Update Docker image (Zephyr update) (project-chip#34503) * Add TransportPayloadCapability flag for GetConnectedDevices and bubble (project-chip#34450) up the flag to the wrapper IM Python APIs. Add python script binding methods for LargePayload tests --to check if session allows large payload. --to close the underlying TCP connection. --to check if the session is active. * Remove no-longer-used MTRDevice logic for truncating data version lists (project-chip#34183) * Remove no-longer-used MTRDevice logic for truncating data version lists After project-chip#34111, ReadClient handles this logic itself, so the attempted truncation in MTRDevice was now dead code. * Address review comment. * Fix compile issues. * Address another review comment. * Address review comment. * Address review comments by JamesH * Remove unnecessary include file * Address further review comments from JamhesH * Restyled by whitespace * Restyled by clang-format * Address further review comments from JamesH * Address further review comments from JamesH * Update examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Undo suggested change from Boris as idx needed in the loop * Update examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp Co-authored-by: lpbeliveau-silabs <[email protected]> * Address review comments --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Junior Martinez <[email protected]> Co-authored-by: C Freeman <[email protected]> Co-authored-by: Alex Tsitsiura <[email protected]> Co-authored-by: Pradip De <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: jamesharrow <[email protected]> Co-authored-by: lpbeliveau-silabs <[email protected]>
project-chip#34488) * Implemented the Quiete reporting quality logic for the CurrentLevel and RemainingTime attributes * Restyled by clang-format * use c++ struct rather than c struct format * add cluster-building-blocks to the data model public dep --------- Co-authored-by: Restyled.io <[email protected]>
* Add WHM to the all clusters app * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Fix CI test * Address review comments from JamesH * Address review comments from JamesH * Address review comments from JamesH * Restyled by clang-format * Get tests passing again * Restyled by clang-format * Declare some global items for future testing (project-chip#34509) Co-authored-by: Andrei Litvin <[email protected]> * [LevelControl] Implemented the Q quality logic for the CurrentLevel a… (project-chip#34488) * Implemented the Quiete reporting quality logic for the CurrentLevel and RemainingTime attributes * Restyled by clang-format * use c++ struct rather than c struct format * add cluster-building-blocks to the data model public dep --------- Co-authored-by: Restyled.io <[email protected]> * Revert thermostat stuff breaking tot (project-chip#34518) * Revert "update tests and thermostat server cluster for new constraints for LocalTemperatureCalibration and MinSetpointDeadBand (project-chip#34474)" This reverts commit 335ac96. * Revert "update constraints for LocalTemperatureCalibration and MinSetpointDeadBand attributes (project-chip#34473)" This reverts commit 21a5bd6. * [Telink] Update Docker image (Zephyr update) (project-chip#34503) * Add TransportPayloadCapability flag for GetConnectedDevices and bubble (project-chip#34450) up the flag to the wrapper IM Python APIs. Add python script binding methods for LargePayload tests --to check if session allows large payload. --to close the underlying TCP connection. --to check if the session is active. * Remove no-longer-used MTRDevice logic for truncating data version lists (project-chip#34183) * Remove no-longer-used MTRDevice logic for truncating data version lists After project-chip#34111, ReadClient handles this logic itself, so the attempted truncation in MTRDevice was now dead code. * Address review comment. * Fix compile issues. * Address another review comment. * Address review comment. * Address review comments by JamesH * Remove unnecessary include file * Address further review comments from JamhesH * Restyled by whitespace * Restyled by clang-format * Address further review comments from JamesH * Address further review comments from JamesH * Update examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Update examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp Co-authored-by: Boris Zbarsky <[email protected]> * Undo suggested change from Boris as idx needed in the loop * Update examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp Co-authored-by: lpbeliveau-silabs <[email protected]> * Address review comments --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Junior Martinez <[email protected]> Co-authored-by: C Freeman <[email protected]> Co-authored-by: Alex Tsitsiura <[email protected]> Co-authored-by: Pradip De <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: jamesharrow <[email protected]> Co-authored-by: lpbeliveau-silabs <[email protected]>
…nd RemainingTime attributes
CurrentLevel attribute is reported on at most every second, but usually 4 times throughout the transition or at transition start and end or if the attribute goes from or to
Null
.RemainingTime is reported on value increase, or when it changes from or to
0
I also cleaned up some namespace usage in the level-control.cpp file
#fixes #33861
Tests: