project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.49k stars 2.01k forks source link

[Build] Unable to set AirQuality Storage as NVM by ZAP tool #29542

Closed erwinpan1 closed 1 year ago

erwinpan1 commented 1 year ago

Build issue(s)

  1. Load zap file by running

    ./scripts/tools/zap/run_zaptool.sh examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
  2. Modify the AirQuality Attribute (of Air Quality Cluster) from External to NVM and click File => Save to save the ZAP file image

  3. Make sure the content is saved into ZAP file

    $ git diff examples/all-clusters-app/
    diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
    index c7ccc67b4b..5c4f529fa0 100644
    --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
    +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
    @@ -16843,7 +16843,7 @@
               "side": "server",
               "type": "AirQualityEnum",
               "included": 1,
    -              "storageOption": "External",
    +              "storageOption": "NVM",
               "singleton": 0,
               "bounded": 0,
               "defaultValue": "0",
  4. Reload ZAP file again, its storage is rollback to "External" image

Platform

No response

Anything else?

No response

bzbarsky-apple commented 1 year ago

The field is implemented via AttributeAccessInterface. It's not stored in the ZAP data store, and therefore ZAP cannot persist it. Persisting this attribute as needed is the responsibility of the application.

The fact that the ZAP UI lets you change the storage from External at all is a bug. See https://github.com/project-chip/zap/issues/1086