@@ -260,6 +260,12 @@ async def test_TC_TSTAT_4_2(self):
260
260
minCoolSetpointLimit = await self .read_single_attribute_check_success (endpoint = endpoint , cluster = cluster , attribute = cluster .Attributes .MinCoolSetpointLimit )
261
261
maxCoolSetpointLimit = await self .read_single_attribute_check_success (endpoint = endpoint , cluster = cluster , attribute = cluster .Attributes .MaxCoolSetpointLimit )
262
262
263
+ asserts .assert_true (minHeatSetpointLimit < maxHeatSetpointLimit , "Heat setpoint range invalid" )
264
+ asserts .assert_true (minCoolSetpointLimit < maxCoolSetpointLimit , "Cool setpoint range invalid" )
265
+
266
+ heatSetpoint = minHeatSetpointLimit + ((maxHeatSetpointLimit - minHeatSetpointLimit ) / 2 )
267
+ coolSetpoint = minCoolSetpointLimit + ((maxCoolSetpointLimit - minCoolSetpointLimit ) / 2 )
268
+
263
269
self .step ("2" )
264
270
if self .pics_guard (self .check_pics ("TSTAT.S.F08" ) and self .check_pics ("TSTAT.S.A0050" )):
265
271
@@ -439,7 +445,7 @@ async def test_TC_TSTAT_4_2(self):
439
445
440
446
# Write to the presets attribute after adding a preset with builtIn set to True
441
447
test_presets .append (cluster .Structs .PresetStruct (presetHandle = NullValue , presetScenario = availableScenario ,
442
- coolingSetpoint = 2800 , heatingSetpoint = 1800 , builtIn = True ))
448
+ coolingSetpoint = coolSetpoint , heatingSetpoint = heatSetpoint , builtIn = True ))
443
449
444
450
status = await self .write_presets (endpoint = endpoint , presets = test_presets , expected_status = Status .ConstraintError )
445
451
@@ -458,7 +464,7 @@ async def test_TC_TSTAT_4_2(self):
458
464
# Write to the presets attribute after adding a preset with a preset handle that doesn't exist in Presets attribute
459
465
test_presets = copy .deepcopy (current_presets )
460
466
test_presets .append (cluster .Structs .PresetStruct (presetHandle = random .randbytes (16 ), presetScenario = cluster .Enums .PresetScenarioEnum .kWake ,
461
- name = "Wake" , coolingSetpoint = 2800 , heatingSetpoint = 1800 , builtIn = True ))
467
+ name = "Wake" , coolingSetpoint = coolSetpoint , heatingSetpoint = heatSetpoint , builtIn = True ))
462
468
463
469
status = await self .write_presets (endpoint = endpoint , presets = test_presets , expected_status = Status .NotFound )
464
470
@@ -523,7 +529,7 @@ async def test_TC_TSTAT_4_2(self):
523
529
524
530
if len (presets_without_name_support ) is 0 and len (availableScenarios ) > 0 :
525
531
new_preset = cluster .Structs .PresetStruct (presetHandle = NullValue , presetScenario = availableScenarios [0 ],
526
- coolingSetpoint = 2800 , heatingSetpoint = 1800 , builtIn = True )
532
+ coolingSetpoint = coolSetpoint , heatingSetpoint = heatSetpoint , builtIn = True )
527
533
test_presets .append (new_preset )
528
534
presets_without_name_support = [new_preset ]
529
535
@@ -553,7 +559,7 @@ async def test_TC_TSTAT_4_2(self):
553
559
# Write to the presets attribute with a new valid preset added
554
560
test_presets = copy .deepcopy (current_presets )
555
561
test_presets .append (cluster .Structs .PresetStruct (presetHandle = NullValue , presetScenario = availableScenario ,
556
- coolingSetpoint = 2800 , heatingSetpoint = 1800 , builtIn = False ))
562
+ coolingSetpoint = coolSetpoint , heatingSetpoint = heatSetpoint , builtIn = False ))
557
563
558
564
# Send the AtomicRequest begin command
559
565
await self .send_atomic_request_begin_command ()
0 commit comments