From 0b183f15aa393626f1668cd43f7ecb5e51680a41 Mon Sep 17 00:00:00 2001 From: jmartinez-silabs <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 8 Jun 2022 16:59:41 -0400 Subject: [PATCH] Change Lvl ctrl min level attribute default (#19312) * Set min_level to one for all lvl control cluster server with featuremap Lighting bit set * regen * Restyled by clang-format * Fix chef app ci by running ./examples/chef/chef.py --generate_zzz locally Co-authored-by: Restyled.io --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 2 +- examples/bridge-app/bridge-common/bridge-app.matter | 2 +- examples/bridge-app/bridge-common/bridge-app.zap | 2 +- examples/chef/devices/lighting-app.zap | 5 +++-- examples/chef/zzz_generated/lighting-app/INPUTMD5.txt | 2 +- .../lighting-app/zap-generated/endpoint_config.h | 2 +- .../light-switch-common/light-switch-app.zap | 2 +- .../lighting-app/lighting-common/lighting-app.matter | 2 +- examples/lighting-app/lighting-common/lighting-app.zap | 2 +- src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml | 5 ++++- src/controller/data_model/controller-clusters.zap | 2 +- .../all-clusters-app/zap-generated/endpoint_config.h | 2 +- zzz_generated/bridge-app/zap-generated/endpoint_config.h | 2 +- zzz_generated/chip-tool/zap-generated/test/Commands.h | 4 +++- .../darwin-framework-tool/zap-generated/test/Commands.h | 9 ++++++++- .../lighting-app/zap-generated/endpoint_config.h | 2 +- 17 files changed, 31 insertions(+), 18 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 184121fda55581..3554d1e36ead68 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4228,7 +4228,7 @@ endpoint 1 { server cluster LevelControl { persist attribute currentLevel default = 0xFE; ram attribute remainingTime; - ram attribute minLevel; + ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; ram attribute currentFrequency; ram attribute minFrequency; 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 403d95a4cc02d8..86dae9e12b478b 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 @@ -9701,7 +9701,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index a6fdec941c6099..b61820abc5b31e 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1422,7 +1422,7 @@ endpoint 1 { server cluster LevelControl { persist attribute currentLevel; ram attribute remainingTime; - ram attribute minLevel; + ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; ram attribute currentFrequency; ram attribute minFrequency; diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 51bb8b92d001ca..db13b9a9f2c922 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -4717,7 +4717,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/lighting-app.zap b/examples/chef/devices/lighting-app.zap index 3b241cf5564c3f..b3183cfc9ce59a 100644 --- a/examples/chef/devices/lighting-app.zap +++ b/examples/chef/devices/lighting-app.zap @@ -6208,7 +6208,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -7711,5 +7711,6 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/zzz_generated/lighting-app/INPUTMD5.txt b/examples/chef/zzz_generated/lighting-app/INPUTMD5.txt index f4b1212da7a458..a73223b32f281c 100644 --- a/examples/chef/zzz_generated/lighting-app/INPUTMD5.txt +++ b/examples/chef/zzz_generated/lighting-app/INPUTMD5.txt @@ -1 +1 @@ -65bbdbd4db827e5f72d20fb32eaae7c0 \ No newline at end of file +1e7c1687f9e61abc2eda4a689dfaabd4 \ No newline at end of file diff --git a/examples/chef/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/examples/chef/zzz_generated/lighting-app/zap-generated/endpoint_config.h index 8b813e7a4bfc6a..b693363305327f 100644 --- a/examples/chef/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/examples/chef/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -472,7 +472,7 @@ /* Endpoint: 1, Cluster: Level Control (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0x01) }, /* current level */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* min level */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* min level */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFE) }, /* max level */ \ { 0x00000004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current frequency */ \ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 732e8866dd8175..70fe778341a154 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -6399,7 +6399,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 4bccb2b2f385bc..2d2773162d0210 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1973,7 +1973,7 @@ endpoint 1 { server cluster LevelControl { persist attribute currentLevel default = 0x01; ram attribute remainingTime; - ram attribute minLevel; + ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; ram attribute currentFrequency; ram attribute minFrequency; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index bd46b99f7a0775..546409132af503 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -6224,7 +6224,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml index 8a3de458560a26..c48f553ea60789 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml @@ -66,13 +66,16 @@ tests: constraints: type: uint16 + # For lighting Device type current level minimal value is 1 - label: "Reads the MinLevel attribute" command: "readAttribute" attribute: "min level" response: - value: 0 + value: 1 constraints: type: uint8 + minValue: 0 + maxValue: 1 - label: "Reads the MaxLevel attribute" command: "readAttribute" diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 4d59bf6fd68553..ad4a9db8a9d0ae 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1311,7 +1311,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 12cb42bab63ab0..d35d116d70c4c0 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -804,7 +804,7 @@ /* Endpoint: 1, Cluster: Level Control (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0xFE) }, /* current level */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* min level */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* min level */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFE) }, /* max level */ \ { 0x00000004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current frequency */ \ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index 99336fb6d9af8c..a9683c3af962bd 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -424,7 +424,7 @@ /* Endpoint: 1, Cluster: Level Control (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0x00) }, /* current level */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* min level */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* min level */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFE) }, /* max level */ \ { 0x00000004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current frequency */ \ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \ diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 8a84ba830363df..0fac39c6b39018 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -14527,8 +14527,10 @@ class Test_TC_LVL_2_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("minLevel", value, 0)); + VerifyOrReturn(CheckValue("minLevel", value, 1)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1)); } break; case 6: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 2f3dbd18f28a5f..dd7bff137d6365 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -25134,10 +25134,17 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("min level", actualValue, 0)); + VerifyOrReturn(CheckValue("min level", actualValue, 1)); } VerifyOrReturn(CheckConstraintType("minLevel", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 1)); + } + NextTest(); }]; diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index bef43ea5f3a57b..3a58b7a54bdea1 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -474,7 +474,7 @@ /* Endpoint: 1, Cluster: Level Control (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0x01) }, /* current level */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* min level */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* min level */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFE) }, /* max level */ \ { 0x00000004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current frequency */ \ { 0x00000005, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* min frequency */ \