Skip to content

Commit c1da2cd

Browse files
Apply ColorTempPhysicalMaxMireds when ColorTemperatureMaximumMireds field is 0. Add tests
1 parent 8ba371a commit c1da2cd

File tree

3 files changed

+163
-2
lines changed

3 files changed

+163
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj,
26972697
{
26982698
colorTemperatureMinimum = tempPhysicalMin;
26992699
}
2700-
if (colorTemperatureMaximum > tempPhysicalMax)
2700+
if ((colorTemperatureMaximum == 0) || (colorTemperatureMaximum > tempPhysicalMax))
27012701
{
27022702
colorTemperatureMaximum = tempPhysicalMax;
27032703
}
@@ -2808,7 +2808,7 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj,
28082808
{
28092809
colorTemperatureMinimum = tempPhysicalMin;
28102810
}
2811-
if (colorTemperatureMaximum > tempPhysicalMax)
2811+
if ((colorTemperatureMaximum == 0) || (colorTemperatureMaximum > tempPhysicalMax))
28122812
{
28132813
colorTemperatureMaximum = tempPhysicalMax;
28142814
}

src/app/tests/suites/certification/Test_TC_CC_6_2.yaml

+77
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,83 @@ tests:
364364
constraints:
365365
minValue: 0
366366
maxValue: 3
367+
- label:
368+
"Step 6a: TH sends MoveColorTemperature command to DUT with MoveMode =
369+
0x03(down), Rate = 65535 (max value) with ColorTemperatureMinimumMireds of 0"
370+
PICS: CC.S.F04 && CC.S.C4b.Rsp
371+
command: MoveColorTemperature
372+
arguments:
373+
values:
374+
- name: "MoveMode"
375+
value: 1
376+
- name: "Rate"
377+
value: 65535
378+
- name: "ColorTemperatureMinimumMireds"
379+
value: 0
380+
- name: "ColorTemperatureMaximumMireds"
381+
value: ColorTempPhysicalMaxMiredsValue
382+
- name: "OptionsMask"
383+
value: 0
384+
- name: "OptionsOverride"
385+
value: 0
386+
387+
- label: "Wait 100ms"
388+
PICS: CC.S.F04
389+
cluster: "DelayCommands"
390+
command: "WaitForMs"
391+
arguments:
392+
values:
393+
- name: "ms"
394+
value: 100
395+
396+
- label: "Step 6b: TH reads ColorTemperatureMireds attribute from DUT."
397+
PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp
398+
command: "readAttribute"
399+
attribute: "ColorTemperatureMireds"
400+
response:
401+
value: ColorTempPhysicalMinMiredsValue
402+
constraints:
403+
minValue: ColorTempPhysicalMinMiredsValue
404+
maxValue: ColorTempPhysicalMaxMiredsValue
405+
406+
- label:
407+
"Step 7a: TH sends MoveColorTemperature command to DUT with MoveMode =
408+
0x01(up), Rate = 65535 (max value) with ColorTemperatureMaximumMireds of 0"
409+
PICS: CC.S.F04 && CC.S.C4b.Rsp
410+
command: MoveColorTemperature
411+
arguments:
412+
values:
413+
- name: "MoveMode"
414+
value: 1
415+
- name: "Rate"
416+
value: 65535
417+
- name: "ColorTemperatureMinimumMireds"
418+
value: ColorTempPhysicalMinMiredsValue
419+
- name: "ColorTemperatureMaximumMireds"
420+
value: 0
421+
- name: "OptionsMask"
422+
value: 0
423+
- name: "OptionsOverride"
424+
value: 0
425+
426+
- label: "Wait 100ms"
427+
PICS: CC.S.F04
428+
cluster: "DelayCommands"
429+
command: "WaitForMs"
430+
arguments:
431+
values:
432+
- name: "ms"
433+
value: 100
434+
435+
- label: "Step 7b: TH reads ColorTemperatureMireds attribute from DUT."
436+
PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp
437+
command: "readAttribute"
438+
attribute: "ColorTemperatureMireds"
439+
response:
440+
value: ColorTempPhysicalMaxMiredsValue
441+
constraints:
442+
minValue: ColorTempPhysicalMinMiredsValue
443+
maxValue: ColorTempPhysicalMaxMiredsValue
367444

368445
- label: "Turn off light that we turned on"
369446
PICS: OO.S.C00.Rsp

src/app/tests/suites/certification/Test_TC_CC_6_3.yaml

+84
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,90 @@ tests:
286286
constraints:
287287
minValue: 0
288288
maxValue: 3
289+
290+
- label:
291+
"Step 5a: TH sends StepColorTemperature command to DUT with StepMode =
292+
0x01 (up), StepSize = ColorTempPhysicalMaxMireds and TransitionTime = 0 (instant)."
293+
PICS: CC.S.F04 && CC.S.C4c.Rsp
294+
command: "StepColorTemperature"
295+
arguments:
296+
values:
297+
- name: "StepMode"
298+
value: 1
299+
- name: "StepSize"
300+
value:
301+
ColorTempPhysicalMaxMiredsValue
302+
- name: "ColorTemperatureMinimumMireds"
303+
value: ColorTempPhysicalMinMiredsValue
304+
- name: "ColorTemperatureMaximumMireds"
305+
value: 0
306+
- name: "TransitionTime"
307+
value: 0
308+
- name: "OptionsMask"
309+
value: 0
310+
- name: "OptionsOverride"
311+
value: 0
312+
313+
- label: "Wait 100ms"
314+
PICS: CC.S.F04
315+
cluster: "DelayCommands"
316+
command: "WaitForMs"
317+
arguments:
318+
values:
319+
- name: "ms"
320+
value: 100
321+
322+
- label: "Step 5b: TH reads ColorTemperatureMireds attribute from DUT."
323+
PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp
324+
command: "readAttribute"
325+
attribute: "ColorTemperatureMireds"
326+
response:
327+
value: ColorTempPhysicalMaxMiredsValue
328+
constraints:
329+
minValue: ColorTempPhysicalMinMiredsValue
330+
maxValue: ColorTempPhysicalMaxMiredsValue
331+
332+
- label:
333+
"Step 6a: TH sends StepColorTemperature command to DUT with StepMode =
334+
0x03 (down), StepSize = ColorTempPhysicalMaxMireds and TransitionTime = 0 (instant)."
335+
PICS: CC.S.F04 && CC.S.C4c.Rsp
336+
command: "StepColorTemperature"
337+
arguments:
338+
values:
339+
- name: "StepMode"
340+
value: 3
341+
- name: "StepSize"
342+
value:
343+
ColorTempPhysicalMaxMiredsValue
344+
- name: "ColorTemperatureMinimumMireds"
345+
value: 0
346+
- name: "ColorTemperatureMaximumMireds"
347+
value: ColorTempPhysicalMaxMiredsValue
348+
- name: "TransitionTime"
349+
value: 0
350+
- name: "OptionsMask"
351+
value: 0
352+
- name: "OptionsOverride"
353+
value: 0
354+
355+
- label: "Wait 100ms"
356+
PICS: CC.S.F04
357+
cluster: "DelayCommands"
358+
command: "WaitForMs"
359+
arguments:
360+
values:
361+
- name: "ms"
362+
value: 100
363+
364+
- label: "Step 6b: TH reads ColorTemperatureMireds attribute from DUT."
365+
PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp
366+
command: "readAttribute"
367+
attribute: "ColorTemperatureMireds"
368+
response:
369+
value: ColorTempPhysicalMinMiredsValue
370+
constraints:
371+
minValue: ColorTempPhysicalMinMiredsValue
372+
maxValue: ColorTempPhysicalMaxMiredsValue
289373

290374
- label: "Turn Off light that we turned on"
291375
PICS: OO.S.C00.Rsp

0 commit comments

Comments
 (0)