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 784bca88b85955..558703a8f12fce 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -2693,11 +2693,16 @@ bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, return true; } + // Per spec, colorTemperatureMinimumMireds field is limited to ColorTempPhysicalMinMireds and + // when colorTemperatureMinimumMireds field is 0, ColorTempPhysicalMinMireds shall be used (always >= to 0) if (colorTemperatureMinimum < tempPhysicalMin) { colorTemperatureMinimum = tempPhysicalMin; } - if (colorTemperatureMaximum > tempPhysicalMax) + + // Per spec, colorTemperatureMaximumMireds field is limited to ColorTempPhysicalMaxMireds and + // when colorTemperatureMaximumMireds field is 0, ColorTempPhysicalMaxMireds shall be used + if ((colorTemperatureMaximum == 0) || (colorTemperatureMaximum > tempPhysicalMax)) { colorTemperatureMaximum = tempPhysicalMax; } @@ -2804,11 +2809,16 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin); Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax); + // Per spec, colorTemperatureMinimumMireds field is limited to ColorTempPhysicalMinMireds and + // when colorTemperatureMinimumMireds field is 0, ColorTempPhysicalMinMireds shall be used (always >= to 0) if (colorTemperatureMinimum < tempPhysicalMin) { colorTemperatureMinimum = tempPhysicalMin; } - if (colorTemperatureMaximum > tempPhysicalMax) + + // Per spec, colorTemperatureMaximumMireds field is limited to ColorTempPhysicalMaxMireds and + // when colorTemperatureMaximumMireds field is 0, ColorTempPhysicalMaxMireds shall be used + if ((colorTemperatureMaximum == 0) || (colorTemperatureMaximum > tempPhysicalMax)) { colorTemperatureMaximum = tempPhysicalMax; } diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml index fcb4f1c7691e8c..f5259372823048 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml @@ -364,6 +364,85 @@ tests: constraints: minValue: 0 maxValue: 3 + - label: + "Step 6a: TH sends MoveColorTemperature command to DUT with MoveMode = + 0x03(down), Rate = 65535 (max value) with + ColorTemperatureMinimumMireds of 0" + PICS: CC.S.F04 && CC.S.C4b.Rsp + command: MoveColorTemperature + arguments: + values: + - name: "MoveMode" + value: 3 + - name: "Rate" + value: 65535 + - name: "ColorTemperatureMinimumMireds" + value: 0 + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 1s" + PICS: CC.S.F04 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + + - label: "Step 6b: TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperatureMireds" + response: + value: ColorTempPhysicalMinMiredsValue + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue + + - label: + "Step 7a: TH sends MoveColorTemperature command to DUT with MoveMode = + 0x01(up), Rate = 65535 (max value) with ColorTemperatureMaximumMireds + of 0" + PICS: CC.S.F04 && CC.S.C4b.Rsp + command: MoveColorTemperature + arguments: + values: + - name: "MoveMode" + value: 1 + - name: "Rate" + value: 65535 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 1s" + PICS: CC.S.F04 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + + - label: "Step 7b: TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperatureMireds" + response: + value: ColorTempPhysicalMaxMiredsValue + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue - label: "Turn off light that we turned on" PICS: OO.S.C00.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml index 934a4a3bfc243a..437ef78af33f27 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml @@ -287,6 +287,90 @@ tests: minValue: 0 maxValue: 3 + - label: + "Step 5a: TH sends StepColorTemperature command to DUT with StepMode = + 0x01 (up), StepSize = ColorTempPhysicalMaxMireds and TransitionTime = + 0 (instant)." + PICS: CC.S.F04 && CC.S.C4c.Rsp + command: "StepColorTemperature" + arguments: + values: + - name: "StepMode" + value: 1 + - name: "StepSize" + value: ColorTempPhysicalMaxMiredsValue + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: 0 + - name: "TransitionTime" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 100ms" + PICS: CC.S.F04 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: "Step 5b: TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperatureMireds" + response: + value: ColorTempPhysicalMaxMiredsValue + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue + + - label: + "Step 6a: TH sends StepColorTemperature command to DUT with StepMode = + 0x03 (down), StepSize = ColorTempPhysicalMaxMireds and TransitionTime + = 0 (instant)." + PICS: CC.S.F04 && CC.S.C4c.Rsp + command: "StepColorTemperature" + arguments: + values: + - name: "StepMode" + value: 3 + - name: "StepSize" + value: ColorTempPhysicalMaxMiredsValue + - name: "ColorTemperatureMinimumMireds" + value: 0 + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "TransitionTime" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 100ms" + PICS: CC.S.F04 + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: "Step 6b: TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperatureMireds" + response: + value: ColorTempPhysicalMinMiredsValue + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue + - label: "Turn Off light that we turned on" PICS: OO.S.C00.Rsp cluster: "On/Off"