Skip to content

Commit 658e1c0

Browse files
committed
Add a test for emergencyBoost=True being specified in the BoostStarted command
1 parent c8a0dda commit 658e1c0

File tree

2 files changed

+59
-8
lines changed

2 files changed

+59
-8
lines changed

examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ void SetTestEventTrigger_BasicInstallationTestEvent()
159159
// Simulate installation in a 100L tank full of water at 20C, with a target temperature of 60C, in OFF mode
160160
dg->SetTankVolume(100);
161161
dg->SetTargetWaterTemperature(6000);
162-
dg->SetHeaterTypes(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1));
162+
163+
// kImmersionElement2 will be used in addition to kImmersionElement1 when emergencyBoost is specified
164+
// in the BoostStarted command.
165+
dg->SetHeaterTypes(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1,
166+
WaterHeaterHeatSourceBitmap::kImmersionElement2));
163167
dg->DrawOffHotWater(100, 2000);
164168
}
165169

src/python_testing/TC_EWATERHTR_2_2.py

+54-7
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,25 @@ def steps_TC_EWATERHTR_2_2(self) -> list[TestStep]:
163163
"Value has to be 0x00 (no demand on any source)"),
164164
TestStep("21b", "TH reads from the DUT the BoostState",
165165
"Value has to be 0 (Inactive)"),
166-
TestStep("22", "TH sends command CancelBoost",
166+
TestStep("22", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Water Temperature 20C Test Event",
167+
"Verify DUT responds w/ status SUCCESS(0x00)"),
168+
TestStep("22a", "TH reads from the DUT the HeatDemand",
169+
"Value has to be 0x00 (no demand on any source)"),
170+
TestStep("23", "TH sends command Boost with Duration=200s,EmergencyBoost=True",
171+
"Verify DUT responds w/ status SUCCESS(0x00) and Event EWATERHTR.S.E00(BoostStarted) sent with Duration=200, EmergencyBoost=True and TemporarySetpoint=None"),
172+
TestStep("23a", "TH reads from the DUT the HeatDemand",
173+
"Value has to be 0x00 (no demand on any source)"),
174+
TestStep("23b", "TH reads from the DUT the BoostState",
175+
"Value has to be 0 (Inactive)"),
176+
TestStep("24", "TH sends command CancelBoost",
177+
"Verify DUT responds w/ status SUCCESS(0x00) and Event EWATERHTR.S.E00(BoostEnded) sent"),
178+
TestStep("24a", "TH reads from the DUT the HeatDemand",
179+
"Value has to be 0x00 (no demand on any source)"),
180+
TestStep("24b", "TH reads from the DUT the BoostState",
181+
"Value has to be 0 (Inactive)"),
182+
TestStep("25", "TH sends command CancelBoost",
167183
"Verify DUT responds w/ status SUCCESS(0x00) and no event sent"),
168-
TestStep("23", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Basic installation Test Event Clear",
184+
TestStep("26", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Basic installation Test Event Clear",
169185
"Verify DUT responds w/ status SUCCESS(0x00)"),
170186
]
171187

@@ -238,10 +254,6 @@ async def test_TC_EWATERHTR_2_2(self):
238254
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostStarted)
239255
asserts.assert_equal(event_data.boostInfo.duration, 5)
240256
asserts.assert_equal(event_data.boostInfo.oneShot, True)
241-
asserts.assert_true(event_data.boostInfo.emergencyBoost is None, "emergencyBoost should be None")
242-
asserts.assert_true(event_data.boostInfo.temporarySetpoint is None, "temporarySetpoint should be None")
243-
asserts.assert_true(event_data.boostInfo.targetPercentage is None, "targetPercentage should be None")
244-
asserts.assert_true(event_data.boostInfo.targetReheat is None, "targetReheat should be None")
245257

246258
self.step("8a")
247259
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
@@ -410,11 +422,46 @@ async def test_TC_EWATERHTR_2_2(self):
410422
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kInactive)
411423

412424
self.step("22")
425+
await self.send_test_event_trigger_water_temperature20C_test_event()
426+
427+
self.step("22a")
428+
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
429+
asserts.assert_equal(heatDemand, 0)
430+
431+
self.step("23")
432+
await self.send_boost_command(duration=200, emergency_boost=True)
433+
434+
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostStarted)
435+
asserts.assert_equal(event_data.boostInfo.duration, 200)
436+
asserts.assert_equal(event_data.boostInfo.emergencyBoost, True)
437+
asserts.assert_is_none(event_data.boostInfo.temporarySetpoint)
438+
439+
self.step("23a")
440+
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
441+
asserts.assert_greater(heatDemand, 0)
442+
asserts.assert_equal(heatDemand & (~heaterTypes), 0, "heatDemand should only be from declared supported types"),
443+
444+
self.step("23b")
445+
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
446+
447+
self.step("24")
448+
await self.send_cancel_boost_command()
449+
450+
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostEnded)
451+
452+
self.step("24a")
453+
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
454+
asserts.assert_equal(heatDemand, 0)
455+
456+
self.step("24b")
457+
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kInactive)
458+
459+
self.step("25")
413460
await self.send_cancel_boost_command()
414461

415462
event_data = events_callback.wait_for_event_expect_no_report()
416463

417-
self.step("23")
464+
self.step("26")
418465
await self.send_test_event_trigger_basic_installation_test_event_clear()
419466

420467

0 commit comments

Comments
 (0)