Skip to content

Change LevelStep in Valve cluster of example app to properly test the feature.#42849

Merged
andy31415 merged 1 commit intoproject-chip:masterfrom
tersal:change-levelstep-in-example-app
Jan 29, 2026
Merged

Change LevelStep in Valve cluster of example app to properly test the feature.#42849
andy31415 merged 1 commit intoproject-chip:masterfrom
tersal:change-levelstep-in-example-app

Conversation

@tersal
Copy link
Copy Markdown
Contributor

@tersal tersal commented Jan 28, 2026

Summary

A change to modify the LevelStep of the Valve cluster to properly test the Open feature.

The previous implementation in the example app used for testing the Valve cluster had a LevelStep value of 1 and the Open command should return ConstraintError when the TargetLevel field of said command is either 0, 100 or any value such as (TargetLevel % LevelStep) == 0.

Since both values are uint that last check will always be true and this won't allow to properly test the error handling.

Related issues

#42778

Testing

CI should pass.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to change the levelStep attribute in the Valve Control cluster to facilitate CI testing. The change is correctly applied to both the .matter and .zap files for the levelStep attribute. However, there are several other modifications in the all-clusters-app.zap file that change other attributes from RAM-based storage to external (callback-based) storage. These changes seem unintentional as they are not mentioned in the pull request description and could introduce regressions. I've added a comment to highlight this potential issue.

Comment thread examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 28, 2026

PR #42849: Size comparison from a3ceb44 to ea26542

Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section a3ceb44 ea26542 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106440 1106440 0 0.0
RAM 178978 178978 0 0.0
bl702 lighting-app bl702+eth FLASH 661210 661210 0 0.0
RAM 135049 135049 0 0.0
bl702+wifi FLASH 837050 837050 0 0.0
RAM 124517 124517 0 0.0
bl706+mfd+rpc+littlefs FLASH 1070974 1070974 0 0.0
RAM 117389 117389 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 903548 903548 0 0.0
RAM 105964 105964 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 983620 983620 0 0.0
RAM 109884 109884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 771284 771284 0 0.0
RAM 103408 103408 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 784320 784320 0 0.0
RAM 108736 108736 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 729456 729456 0 0.0
RAM 97484 97484 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 714032 714032 0 0.0
RAM 97692 97692 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 555340 555340 0 0.0
RAM 205496 205496 0 0.0
lock CC3235SF_LAUNCHXL FLASH 589224 589224 0 0.0
RAM 205752 205752 0 0.0
efr32 lock-app BRD4187C FLASH 967312 967304 -8 -0.0
RAM 123656 123656 0 0.0
BRD4338a FLASH 761124 761124 0 0.0
RAM 236944 236944 0 0.0
window-app BRD4187C FLASH 1063584 1063576 -8 -0.0
RAM 124780 124780 0 0.0
esp32 all-clusters-app c3devkit DRAM 98204 98204 0 0.0
FLASH 1584468 1584468 0 0.0
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 935932 935932 0 0.0
RAM 161974 161975 1 0.0
nxp contact mcxw71+release FLASH 744632 744632 0 0.0
RAM 67152 67152 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1696244 1696244 0 0.0
RAM 214484 214484 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1597300 1597300 0 0.0
RAM 211476 211476 0 0.0
light cy8ckit_062s2_43012 FLASH 1460940 1460940 0 0.0
RAM 197808 197808 0 0.0
lock cy8ckit_062s2_43012 FLASH 1495044 1495044 0 0.0
RAM 225688 225688 0 0.0
qpg lighting-app qpg6200+debug FLASH 838716 838716 0 0.0
RAM 128032 128032 0 0.0
lock-app qpg6200+debug FLASH 777164 777164 0 0.0
RAM 118972 118972 0 0.0
realtek light-switch-app rtl8777g FLASH 701992 701992 0 0.0
RAM 113548 113548 0 0.0
lighting-app rtl8777g FLASH 743872 743872 0 0.0
RAM 114768 114768 0 0.0
stm32 light STM32WB5MM-DK FLASH 470804 470804 0 0.0
RAM 141408 141408 0 0.0
telink bridge-app tl7218x FLASH 711642 711642 0 0.0
RAM 93088 93088 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797432 797432 0 0.0
RAM 41272 41272 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 788762 788762 0 0.0
RAM 96172 96172 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 717432 717432 0 0.0
RAM 54264 54264 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 753242 753242 0 0.0
RAM 73288 73288 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 721814 721814 0 0.0
RAM 34992 34992 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 609728 609728 0 0.0
RAM 117960 117960 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822266 822270 4 0.0
RAM 94560 94560 0 0.0

@tersal tersal changed the title [CI TESTING] Change LevelStep attribute to 2 to properly test feature Change LevelStep in Valve cluster of example app to properly test the feature. Jan 28, 2026
@tersal tersal marked this pull request as ready for review January 28, 2026 22:11
Copilot AI review requested due to automatic review settings January 28, 2026 22:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve testing coverage for the Valve cluster's Open command by changing the LevelStep attribute value from 1 to 2. The motivation is that with LevelStep = 1, the constraint check (TargetLevel % LevelStep) == 0 is always true for any value, preventing proper testing of the CONSTRAINT_ERROR code path. Changing to LevelStep = 2 enables testing of values that should trigger this error (e.g., odd values like 1, 3, 5).

Changes:

  • Changed the LevelStep attribute of the Valve cluster from external storage with default 1 to RAM storage with default 2 on endpoint 1
  • Unintentionally changed three ClusterRevision attributes from RAM to External storage (not mentioned in PR description)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
examples/all-clusters-app/all-clusters-common/all-clusters-app.zap Contains four storage/default value changes: the intended LevelStep change and three undocumented ClusterRevision changes for Unit Localization and Scenes Management clusters
examples/all-clusters-app/all-clusters-common/all-clusters-app.matter Reflects only the intended LevelStep change from callback to RAM storage with default value 2

Comment thread examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Comment thread examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Comment thread examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@andy31415 andy31415 added the sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews. label Jan 29, 2026
@andy31415 andy31415 merged commit 2c31480 into project-chip:master Jan 29, 2026
84 checks passed
@tersal tersal deleted the change-levelstep-in-example-app branch March 11, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples review - pending sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants