Skip to content

Commit 5f4c6a5

Browse files
Make StartUpColorTemperatureMireds nullable, per spec.
Fixes project-chip#21855
1 parent 0d64c0b commit 5f4c6a5

File tree

32 files changed

+306
-137
lines changed

32 files changed

+306
-137
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -2850,7 +2850,7 @@ server cluster ColorControl = 768 {
28502850
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
28512851
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
28522852
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
2853-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
2853+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
28542854
readonly attribute bitmap32 featureMap = 65532;
28552855
readonly attribute int16u clusterRevision = 65533;
28562856

examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ server cluster ColorControl = 768 {
16141614
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
16151615
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
16161616
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
1617-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
1617+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
16181618
readonly attribute command_id generatedCommandList[] = 65528;
16191619
readonly attribute command_id acceptedCommandList[] = 65529;
16201620
readonly attribute attrib_id attributeList[] = 65531;

examples/light-switch-app/light-switch-common/light-switch-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ client cluster ColorControl = 768 {
15651565
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
15661566
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
15671567
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
1568-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
1568+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
15691569
readonly attribute int16u clusterRevision = 65533;
15701570

15711571
request struct MoveToHueRequest {

examples/lighting-app/lighting-common/lighting-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ server cluster ColorControl = 768 {
15111511
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
15121512
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
15131513
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
1514-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
1514+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
15151515
readonly attribute bitmap32 featureMap = 65532;
15161516
readonly attribute int16u clusterRevision = 65533;
15171517

examples/placeholder/linux/apps/app1/config.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ server cluster ColorControl = 768 {
19161916
readonly attribute int16u currentY = 4;
19171917
attribute bitmap8 options = 15;
19181918
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
1919-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
1919+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
19201920
readonly attribute bitmap32 featureMap = 65532;
19211921
readonly attribute int16u clusterRevision = 65533;
19221922

examples/placeholder/linux/apps/app2/config.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ server cluster ColorControl = 768 {
19161916
readonly attribute int16u currentY = 4;
19171917
attribute bitmap8 options = 15;
19181918
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
1919-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
1919+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
19201920
readonly attribute bitmap32 featureMap = 65532;
19211921
readonly attribute int16u clusterRevision = 65533;
19221922

src/app/clusters/color-control-server/color-control-server.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -2071,13 +2071,13 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint)
20712071
// the StartUpColorTemperatureMireds attribute are listed in the table below.
20722072
// Value Action on power up
20732073
// 0x0000-0xffef Set the ColorTemperatureMireds attribute to this value.
2074-
// 0xffff Set the ColorTemperatureMireds attribute to its previous value.
2074+
// null Set the ColorTemperatureMireds attribute to its previous value.
20752075

2076-
// Initialize startUpColorTempMireds to "maintain previous value" value 0xFFFF
2077-
uint16_t startUpColorTemp = 0xFFFF;
2078-
EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, &startUpColorTemp);
2076+
// Initialize startUpColorTempMireds to "maintain previous value" value null
2077+
app::DataModel::Nullable<uint16_t> startUpColorTemp;
2078+
EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
20792079

2080-
if (status == EMBER_ZCL_STATUS_SUCCESS)
2080+
if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpColorTemp.IsNull())
20812081
{
20822082
uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE;
20832083
status = Attributes::ColorTemperature::Get(endpoint, &updatedColorTemp);
@@ -2090,13 +2090,13 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint)
20902090
uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE;
20912091
Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax);
20922092

2093-
if (tempPhysicalMin <= startUpColorTemp && startUpColorTemp <= tempPhysicalMax)
2093+
if (tempPhysicalMin <= startUpColorTemp.Value() && startUpColorTemp.Value() <= tempPhysicalMax)
20942094
{
20952095
// Apply valid startup color temp value that is within physical limits of device.
20962096
// Otherwise, the startup value is outside the device's supported range, and the
20972097
// existing setting of ColorTemp attribute will be left unchanged (i.e., treated as
2098-
// if startup color temp was set to 0xFFFF).
2099-
updatedColorTemp = startUpColorTemp;
2098+
// if startup color temp was set to null).
2099+
updatedColorTemp = startUpColorTemp.Value();
21002100
status = Attributes::ColorTemperature::Set(endpoint, updatedColorTemp);
21012101

21022102
if (status == EMBER_ZCL_STATUS_SUCCESS)

src/app/zap-templates/zcl/data-model/silabs/ha.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ limitations under the License.
243243
</attribute>
244244
<!-- COLOR_POINT_B_INTENSITY -->
245245
<attribute side="server" code="0x400D" define="COLOR_CONTROL_TEMPERATURE_LEVEL_MIN_MIREDS" type="INT16U" min="0x0000" max="0xFFFF" writable="false" optional="true">CoupleColorTempToLevelMinMireds</attribute>
246-
<attribute side="server" code="0x4010" define="START_UP_COLOR_TEMPERATURE_MIREDS" type="INT16U" min="0x0000" max="0xFEFF" writable="true" optional="true">
246+
<attribute side="server" code="0x4010" define="START_UP_COLOR_TEMPERATURE_MIREDS" type="INT16U" min="0x0000" max="0xFEFF" writable="true" isNullable="true" optional="true">
247247
<description>StartUpColorTemperatureMireds</description>
248248
<access op="read" role="view"/>
249249
<access op="write" role="manage"/>

src/controller/data_model/controller-clusters.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -3178,7 +3178,7 @@ client cluster ColorControl = 768 {
31783178
readonly attribute int16u colorTempPhysicalMinMireds = 16395;
31793179
readonly attribute int16u colorTempPhysicalMaxMireds = 16396;
31803180
readonly attribute int16u coupleColorTempToLevelMinMireds = 16397;
3181-
attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400;
3181+
attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400;
31823182
readonly attribute command_id generatedCommandList[] = 65528;
31833183
readonly attribute command_id acceptedCommandList[] = 65529;
31843184
readonly attribute attrib_id attributeList[] = 65531;

src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp

+11-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp

+10-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/CHIPReadCallbacks.cpp

+67
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/CHIPReadCallbacks.h

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java

+16-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/python/chip/clusters/Objects.py

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)