|
44 | 44 | import time
|
45 | 45 |
|
46 | 46 | import chip.clusters as Clusters
|
47 |
| -from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, |
48 |
| - async_test_body, await_sequence_of_reports, default_matter_test_main) |
| 47 | +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, |
| 48 | + await_sequence_of_reports, default_matter_test_main) |
49 | 49 | from mobly import asserts
|
50 | 50 |
|
51 | 51 |
|
@@ -177,30 +177,10 @@ async def test_TC_OCC_3_2(self):
|
177 | 177 |
|
178 | 178 | self.step("4c")
|
179 | 179 | await self.write_single_attribute(attributes.HoldTime(hold_time_max))
|
180 |
| - hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) |
181 |
| - asserts.assert_equal(hold_time_dut, hold_time_max, "HoldTime did not match written HoldTimeMax") |
182 | 180 |
|
183 | 181 | self.step("4d")
|
184 |
| - has_no_legacy_features = ((not has_feature_pir) and (not has_feature_ultrasonic) and (not has_feature_contact)) |
185 |
| - |
186 |
| - expect_legacy_pir_timing = has_pir_timing_attrib and (has_feature_pir or has_no_legacy_features) |
187 |
| - expect_legacy_us_timing = has_ultrasonic_timing_attrib and has_feature_ultrasonic |
188 |
| - expect_legacy_phy_timing = has_contact_timing_attrib and has_feature_contact |
189 |
| - |
190 |
| - # Build list of expectations based on attributes present. |
191 |
| - all_expected_final_values = [AttributeValue(endpoint_id, attribute=cluster.Attributes.HoldTime, value=hold_time_max)] |
192 |
| - if expect_legacy_pir_timing: |
193 |
| - all_expected_final_values.append(AttributeValue( |
194 |
| - endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, value=hold_time_max)) |
195 |
| - if expect_legacy_us_timing: |
196 |
| - all_expected_final_values.append(AttributeValue( |
197 |
| - endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, value=hold_time_max)) |
198 |
| - if expect_legacy_phy_timing: |
199 |
| - all_expected_final_values.append(AttributeValue( |
200 |
| - endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, value=hold_time_max)) |
201 |
| - |
202 |
| - # Wait for the reports to come. |
203 |
| - attrib_listener.await_all_final_values_reported(all_expected_final_values, timeout_sec=post_prompt_settle_delay_seconds) |
| 182 | + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, |
| 183 | + attribute=cluster.Attributes.HoldTime, sequence=[hold_time_max], timeout_sec=post_prompt_settle_delay_seconds) |
204 | 184 |
|
205 | 185 |
|
206 | 186 | if __name__ == "__main__":
|
|
0 commit comments