Update ColorControl bounds based on spec fixes (#35156)
* Update color defaults in samples
* Update color control server logic to avoid div-by-zero
* Update TC-CC-2.1 with new bounds on ColorControl
* Restyled by clang-format
* More fixes to CI
* Set default startup mireds to null
* Fix some comments
* Try to fix CI
---------
Co-authored-by: Restyled.io <commits@restyled.io>
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 dbaaf04..6926da1 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
@@ -9168,10 +9168,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- persist attribute startUpColorTemperatureMireds;
+ persist attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0x1F;
ram attribute clusterRevision default = 7;
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 9a736ee..cecc10f 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
@@ -18200,7 +18200,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -18216,7 +18216,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -18248,7 +18248,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter
index d8758b3..0a59101 100644
--- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter
+++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter
@@ -2356,10 +2356,10 @@
ram attribute enhancedCurrentHue default = 0x0000;
ram attribute enhancedColorMode default = 0x02;
ram attribute colorCapabilities default = 0x0000;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap
index d9ba9c9..c53b6ae 100644
--- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap
+++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap
@@ -3797,7 +3797,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -3813,7 +3813,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -3845,7 +3845,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter
index 0ef1c96..53984bb 100644
--- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter
+++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter
@@ -2468,10 +2468,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x0000;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds default = 0x0000;
- ram attribute startUpColorTemperatureMireds default = 0;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap
index f0fc3c6..9debf6b 100644
--- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap
+++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap
@@ -3901,7 +3901,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -3917,7 +3917,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -3949,7 +3949,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap
index 2e72d5b..7794e2b 100644
--- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap
+++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap
@@ -5484,7 +5484,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5500,7 +5500,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5532,7 +5532,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter
index 30f4d63..9536120 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter
@@ -2535,10 +2535,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0x1F;
ram attribute clusterRevision default = 7;
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap
index 87d6c2f..933adab 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap
@@ -4220,7 +4220,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -4236,7 +4236,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -4268,7 +4268,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter
index 2abf5c7..5a26a33 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter
@@ -2721,10 +2721,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0x1F;
ram attribute clusterRevision default = 7;
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap
index 95e21f9..bac1dcc 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap
@@ -5196,7 +5196,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5212,7 +5212,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5244,7 +5244,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter
index b9dfeee..08172f4 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter
@@ -2584,10 +2584,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0x1F;
ram attribute clusterRevision default = 7;
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap
index 35a6c1a..39f1cc2 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap
@@ -4403,7 +4403,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -4419,7 +4419,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -4451,7 +4451,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter
index 700b615..578fa85 100644
--- a/examples/lighting-app/lighting-common/lighting-app.matter
+++ b/examples/lighting-app/lighting-common/lighting-app.matter
@@ -3173,10 +3173,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- persist attribute startUpColorTemperatureMireds;
+ persist attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0x1F;
ram attribute clusterRevision default = 7;
diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap
index e73563e..acdafaa 100644
--- a/examples/lighting-app/lighting-common/lighting-app.zap
+++ b/examples/lighting-app/lighting-common/lighting-app.zap
@@ -5733,7 +5733,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5749,7 +5749,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5781,7 +5781,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter
index 35e0005..8ce7501 100644
--- a/examples/lighting-app/qpg/zap/light.matter
+++ b/examples/lighting-app/qpg/zap/light.matter
@@ -2698,10 +2698,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap
index 6390c7f..35b8f30 100644
--- a/examples/lighting-app/qpg/zap/light.zap
+++ b/examples/lighting-app/qpg/zap/light.zap
@@ -5881,7 +5881,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5897,7 +5897,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5929,7 +5929,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
index f4c2928..d77bd64 100644
--- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
+++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
@@ -2748,10 +2748,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- persist attribute startUpColorTemperatureMireds;
+ persist attribute startUpColorTemperatureMireds default = 0x00FA;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap
index a3fd5e5..42b5eb3 100644
--- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap
+++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap
@@ -5172,7 +5172,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5188,7 +5188,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -5220,7 +5220,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
index 59919ee..978f277 100644
--- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
+++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
@@ -3041,10 +3041,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x0000;
ram attribute colorCapabilities default = 0x1F;
- ram attribute colorTempPhysicalMinMireds default = 0x0000;
- ram attribute colorTempPhysicalMaxMireds default = 0xFEFF;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- persist attribute startUpColorTemperatureMireds;
+ persist attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0x1F;
ram attribute clusterRevision default = 7;
diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
index 6d438d1..92e4546 100644
--- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
+++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
@@ -4947,7 +4947,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -4963,7 +4963,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -4995,7 +4995,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index a3a313d..a92f0a4 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -9575,10 +9575,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x00;
ram attribute colorCapabilities default = 0x00;
- ram attribute colorTempPhysicalMinMireds default = 0x00;
- ram attribute colorTempPhysicalMaxMireds default = 0xfeff;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 7;
diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap
index 0dff614..c6bf896 100644
--- a/examples/placeholder/linux/apps/app1/config.zap
+++ b/examples/placeholder/linux/apps/app1/config.zap
@@ -14786,7 +14786,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x00",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -14802,7 +14802,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xfeff",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -14834,7 +14834,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index e1920f4..facd9c9 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -9514,10 +9514,10 @@
ram attribute colorLoopStartEnhancedHue default = 0x2300;
ram attribute colorLoopStoredEnhancedHue default = 0x00;
ram attribute colorCapabilities default = 0x00;
- ram attribute colorTempPhysicalMinMireds default = 0x00;
- ram attribute colorTempPhysicalMaxMireds default = 0xfeff;
+ ram attribute colorTempPhysicalMinMireds default = 0x009A;
+ ram attribute colorTempPhysicalMaxMireds default = 0x01C6;
ram attribute coupleColorTempToLevelMinMireds;
- ram attribute startUpColorTemperatureMireds;
+ ram attribute startUpColorTemperatureMireds default = 0x00FA;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 7;
diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap
index a3b75ae..22e1cb6 100644
--- a/examples/placeholder/linux/apps/app2/config.zap
+++ b/examples/placeholder/linux/apps/app2/config.zap
@@ -14546,7 +14546,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x00",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -14562,7 +14562,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xfeff",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -14594,7 +14594,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap
index 1cbd309..ccc4190 100644
--- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap
+++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap
@@ -17711,7 +17711,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0000",
+ "defaultValue": "0x009A",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -17727,7 +17727,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0xFEFF",
+ "defaultValue": "0x01C6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -17759,7 +17759,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x00FA",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h
index 3146dd9..9eff91f 100644
--- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h
+++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h
@@ -322,15 +322,15 @@
{ (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* ScheduleProgrammingVisibility */ \
\
/* Endpoint: 1, Cluster: Color Control (server) */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointX */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointY */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRX */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRY */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGX */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGY */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBX */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBY */ \
- { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* StartUpColorTemperatureMireds */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointX */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* WhitePointY */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRX */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointRY */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGX */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointGY */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBX */ \
+ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* ColorPointBY */ \
+ { (uint16_t) 0xFA, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* StartUpColorTemperatureMireds */ \
\
/* Endpoint: 1, Cluster: Ballast Configuration (server) */ \
{ (uint16_t) 0x1, (uint16_t) 0x1, (uint16_t) 0xFE }, /* MinLevel */ \
@@ -1495,8 +1495,8 @@
{ ZAP_SIMPLE_DEFAULT(0x2300), 0x00004005, 2, ZAP_TYPE(INT16U), 0 }, /* ColorLoopStartEnhancedHue */ \
{ ZAP_SIMPLE_DEFAULT(0x0000), 0x00004006, 2, ZAP_TYPE(INT16U), 0 }, /* ColorLoopStoredEnhancedHue */ \
{ ZAP_SIMPLE_DEFAULT(0x1F), 0x0000400A, 2, ZAP_TYPE(BITMAP16), 0 }, /* ColorCapabilities */ \
- { ZAP_SIMPLE_DEFAULT(0x0000), 0x0000400B, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMinMireds */ \
- { ZAP_SIMPLE_DEFAULT(0xFEFF), 0x0000400C, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMaxMireds */ \
+ { ZAP_SIMPLE_DEFAULT(0x009A), 0x0000400B, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMinMireds */ \
+ { ZAP_SIMPLE_DEFAULT(0x01C6), 0x0000400C, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMaxMireds */ \
{ ZAP_EMPTY_DEFAULT(), 0x0000400D, 2, ZAP_TYPE(INT16U), 0 }, /* CoupleColorTempToLevelMinMireds */ \
{ ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00004010, 2, ZAP_TYPE(INT16U), \
ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \
diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp
index 406d06f..0555352 100644
--- a/src/app/clusters/color-control-server/color-control-server.cpp
+++ b/src/app/clusters/color-control-server/color-control-server.cpp
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "color-control-server.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
@@ -2586,6 +2588,9 @@
uint16_t temperatureMin = MIN_TEMPERATURE_VALUE;
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &temperatureMin);
+ // Avoid potential divide-by-zero in future Kelvin conversions.
+ temperatureMin = std::max(static_cast<uint16_t>(1u), temperatureMin);
+
uint16_t temperatureMax = MAX_TEMPERATURE_VALUE;
Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &temperatureMax);
@@ -2640,6 +2645,9 @@
{
// Not less than the physical min.
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
+
+ // Avoid potential divide-by-zero in future Kelvin conversions.
+ colorTemperatureCoupleToLevelMin = std::max(static_cast<uint16_t>(1u), colorTemperatureCoupleToLevelMin);
}
return colorTemperatureCoupleToLevelMin;
@@ -2670,11 +2678,11 @@
// EnhancedColorMode attributes SHALL be set to 0x02 (color temperature). The values of
// the StartUpColorTemperatureMireds attribute are listed in the table below.
// Value Action on power up
- // 0x0000-0xffef Set the ColorTemperatureMireds attribute to this value.
+ // 0x0001-0xffef Set the ColorTemperatureMireds attribute to this value.
// null Set the ColorTemperatureMireds attribute to its previous value.
// Initialize startUpColorTempMireds to "maintain previous value" value null
- app::DataModel::Nullable<uint16_t> startUpColorTemp;
+ app::DataModel::Nullable<uint16_t> startUpColorTemp = DataModel::NullNullable;
Status status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
if (status == Status::Success && !startUpColorTemp.IsNull())
@@ -2686,6 +2694,8 @@
{
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
+ // Avoid potential divide-by-zero in future Kelvin conversions.
+ tempPhysicalMin = std::max(static_cast<uint16_t>(1u), tempPhysicalMin);
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax);
@@ -2807,6 +2817,9 @@
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax);
+ // Avoid potential divide-by-zero in future Kelvin conversions.
+ tempPhysicalMin = std::max(static_cast<uint16_t>(1u), tempPhysicalMin);
+
// New command. Need to stop any active transitions.
stopAllColorTransitions(endpoint);
@@ -2817,7 +2830,7 @@
}
// Per spec, colorTemperatureMinimumMireds field is limited to ColorTempPhysicalMinMireds and
- // when colorTemperatureMinimumMireds field is 0, ColorTempPhysicalMinMireds shall be used (always >= to 0)
+ // when colorTemperatureMinimumMireds field is 0, ColorTempPhysicalMinMireds shall be used (always > 0)
if (colorTemperatureMinimum < tempPhysicalMin)
{
colorTemperatureMinimum = tempPhysicalMin;
@@ -2933,8 +2946,11 @@
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax);
+ // Avoid potential divide-by-zero in future Kelvin conversions.
+ tempPhysicalMin = std::max(static_cast<uint16_t>(1u), tempPhysicalMin);
+
// Per spec, colorTemperatureMinimumMireds field is limited to ColorTempPhysicalMinMireds and
- // when colorTemperatureMinimumMireds field is 0, ColorTempPhysicalMinMireds shall be used (always >= to 0)
+ // when colorTemperatureMinimumMireds field is 0, ColorTempPhysicalMinMireds shall be used (always > 0)
if (colorTemperatureMinimum < tempPhysicalMin)
{
colorTemperatureMinimum = tempPhysicalMin;
@@ -2953,6 +2969,8 @@
// now, kick off the state machine.
colorTempTransitionState->initialValue = 0;
Attributes::ColorTemperatureMireds::Get(endpoint, &colorTempTransitionState->initialValue);
+ colorTempTransitionState->initialValue = std::max(static_cast<uint16_t>(1u), colorTempTransitionState->initialValue);
+
colorTempTransitionState->currentValue = colorTempTransitionState->initialValue;
if (stepMode == HueStepMode::kUp)
diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h
index 1ed9e33..88343e7 100644
--- a/src/app/clusters/color-control-server/color-control-server.h
+++ b/src/app/clusters/color-control-server/color-control-server.h
@@ -43,8 +43,10 @@
static constexpr uint16_t MIN_CIE_XY_VALUE = 0;
static constexpr uint16_t MAX_CIE_XY_VALUE = 0xfeff; // this value comes directly from the ZCL specification table 5.3
-static constexpr uint16_t MIN_TEMPERATURE_VALUE = 0;
-static constexpr uint16_t MAX_TEMPERATURE_VALUE = 0xfeff;
+// Logically relevant color temperatures are between 1000K and 9000K at the very most (and this is still
+// not frequent). Our implementation can default to those reasonable maxima to avoid issues related to range.
+static constexpr uint16_t MIN_TEMPERATURE_VALUE = 111u; // 111 mireds == 9000K
+static constexpr uint16_t MAX_TEMPERATURE_VALUE = 1000u; // 1000 mireds == 1000K
static constexpr uint8_t MIN_HUE_VALUE = 0;
static constexpr uint8_t MAX_HUE_VALUE = 254;
diff --git a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml
index 294cb9a..b24a3d0 100644
--- a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml
@@ -115,7 +115,7 @@
response:
constraints:
type: int16u
- minValue: 0
+ minValue: 1
maxValue: 65279
- label: "Step 10: TH reads from the DUT the (0x0008) ColorMode attribute"
@@ -250,7 +250,7 @@
response:
constraints:
type: int16u
- minValue: 0
+ minValue: 1
maxValue: 65279
- label:
@@ -262,7 +262,7 @@
response:
constraints:
type: int16u
- minValue: 0
+ minValue: 1
maxValue: 65279
- label:
@@ -286,8 +286,7 @@
response:
constraints:
type: int16u
- minValue: 0
- maxValue: 65279
+ python: (value is None) or ((value >= 1) and (value <= 65279))
#Defined Primaries Information Attribute Set
- label:
diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml
index 3bab443..38f3365 100755
--- a/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml
@@ -55,7 +55,7 @@
response:
constraints:
type: int16u
- minValue: 0
+ minValue: 1
maxValue: 65279
- label: "Step 0d: TH reads ColorTempPhysicalMinMireds attribute from DUT."
@@ -65,7 +65,7 @@
response:
constraints:
type: int16u
- minValue: 0
+ minValue: 1
maxValue: 65279
- label: "Step 0e: TH reads ColorTempPhysicalMaxMireds attribute from DUT."
@@ -75,7 +75,7 @@
response:
constraints:
type: int16u
- minValue: 0
+ minValue: 1
maxValue: 65279
- label:
@@ -87,8 +87,7 @@
response:
constraints:
type: int16u
- minValue: 0
- maxValue: 65279
+ python: (value is None) or ((value >= 1) and (value <= 65279))
- label:
"Step 2a: TH writes to StartUpColorTemperatureMireds attribute with
@@ -141,8 +140,7 @@
saveAs: StartUpColorTemperatureMiredsValue
constraints:
type: int16u
- minValue: 0
- maxValue: 65279
+ python: (value is None) or ((value >= 1) and (value <= 65279))
- label:
"Step 2b: Verify that the DUT response contains
diff --git a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml
index f72140e..3623ce1 100644
--- a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml
@@ -141,7 +141,7 @@
<!-- DRIFT_COMPENSATION -->
<attribute side="server" code="0x0006" define="COLOR_CONTROL_COMPENSATION_TEXT" type="char_string" length="254" writable="false" optional="true">CompensationText</attribute>
<!-- COMPENSATION_TEXT -->
- <attribute side="server" code="0x0007" define="COLOR_CONTROL_COLOR_TEMPERATURE" type="int16u" min="0x0000" max="0xFEFF" writable="false" reportable="true" default="0x00FA" optional="true">ColorTemperatureMireds</attribute>
+ <attribute side="server" code="0x0007" define="COLOR_CONTROL_COLOR_TEMPERATURE" type="int16u" min="0x0001" max="0xFEFF" writable="false" reportable="true" default="0x00FA" optional="true">ColorTemperatureMireds</attribute>
<!-- COLOR_TEMPERATURE -->
<attribute side="server" code="0x0008" define="COLOR_CONTROL_COLOR_MODE" type="ColorModeEnum" writable="false" default="0x01">ColorMode</attribute>
<!-- COLOR_MODE -->
@@ -384,7 +384,7 @@
<attribute side="server" code="0x4005" define="COLOR_CONTROL_COLOR_LOOP_START_ENHANCED_HUE" type="int16u" min="0x0000" max="0xFFFF" writable="false" default="0x2300" optional="true">ColorLoopStartEnhancedHue</attribute>
<attribute side="server" code="0x4006" define="COLOR_CONTROL_COLOR_LOOP_STORED_ENHANCED_HUE" type="int16u" min="0x0000" max="0xFFFF" writable="false" default="0x0000" optional="true">ColorLoopStoredEnhancedHue</attribute>
<attribute side="server" code="0x400A" define="COLOR_CONTROL_COLOR_CAPABILITIES" type="ColorCapabilitiesBitmap" min="0x0000" max="0x001F" writable="false" default="0x0000">ColorCapabilities</attribute>
- <attribute side="server" code="0x400B" define="COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN" type="int16u" min="0x0000" max="0xFEFF" writable="false" default="0x0000" optional="true">ColorTempPhysicalMinMireds</attribute>
+ <attribute side="server" code="0x400B" define="COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN" type="int16u" min="0x0001" max="0xFEFF" writable="false" default="0x0000" optional="true">ColorTempPhysicalMinMireds</attribute>
<attribute side="server" code="0x400C" define="COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MAX" type="int16u" min="0x0000" max="0xFEFF" writable="false" default="0xFEFF" optional="true">ColorTempPhysicalMaxMireds</attribute>
<command source="client" code="0x40" name="EnhancedMoveToHue" optional="true" noDefaultImplementation="true" cli="zcl color-control emovetohue">