@@ -45,7 +45,7 @@ async def set_power_setting_expect_failure(self, endpoint, value):
45
45
asserts .assert_fail ("Expected an exception but received none." )
46
46
except InteractionModelError as e :
47
47
asserts .assert_equal (e .status , Status .ConstraintError ,
48
- "Expected ConstraintError but received a different response: %x" , e . status )
48
+ "Expected ConstraintError but received a different response" )
49
49
50
50
async def read_and_check_power_setting_value (self , endpoint , value ):
51
51
powerValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = Clusters .MicrowaveOvenControl .Attributes .PowerSetting )
@@ -103,31 +103,36 @@ async def test_TC_MWOCTRL_2_2(self):
103
103
self .step (2 )
104
104
minPowerValue = 10
105
105
106
+ feature_map = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .FeatureMap )
107
+ is_pwrnum_feature_supported = feature_map & features .kPowerAsNumber
108
+ is_watts_feature_supported = feature_map & features .kPowerInWatts
109
+ is_pwrlmits_feature_supported = feature_map & features .kPowerNumberLimits
110
+
106
111
self .step (3 )
107
- if self . pics_guard ( self . check_pics ( "MWOCTRL.S.F02" )) :
112
+ if is_pwrlmits_feature_supported :
108
113
minPowerValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .MinPower )
109
- logging .info ("MinPower is %s" % minPowerValue )
110
114
asserts .assert_true (minPowerValue >= 1 , "MinPower is less than 1" )
115
+ logging .info ("MinPower is %s" % minPowerValue )
111
116
112
117
self .step (4 )
113
118
maxPowerValue = 100
114
119
115
120
self .step (5 )
116
- if self . pics_guard ( self . check_pics ( "MWOCTRL.S.F02" )) :
121
+ if is_pwrlmits_feature_supported :
117
122
maxPowerValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .MaxPower )
118
- logging .info ("MaxPower is %s" % maxPowerValue )
119
123
asserts .assert_true (maxPowerValue >= minPowerValue , "MaxPower is less than MinPower" )
120
124
asserts .assert_true (maxPowerValue <= 100 , "MaxPower is greater than 100" )
125
+ logging .info ("MaxPower is %s" % maxPowerValue )
121
126
122
127
self .step (6 )
123
128
powerStepValue = 10
124
129
125
130
self .step (7 )
126
- if self . pics_guard ( self . check_pics ( "MWOCTRL.S.F02" )) :
131
+ if is_pwrlmits_feature_supported :
127
132
powerStepValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .PowerStep )
128
- logging .info ("PowerStep is %s" % powerStepValue )
129
133
asserts .assert_true (powerStepValue >= 1 , "PowerStep is less than 1" )
130
134
asserts .assert_true (powerStepValue <= maxPowerValue , "PowerStep is greater than MaxPower" )
135
+ logging .info ("PowerStep is %s" % powerStepValue )
131
136
132
137
self .step (8 )
133
138
powerValue = await self .read_mwoctrl_attribute_expect_success (endpoint = endpoint , attribute = attributes .PowerSetting )
0 commit comments