@@ -109,11 +109,12 @@ async def read_verify_setting(self, attribute, type, range):
109
109
# Verify response is valid (value is within expected range)
110
110
asserts .assert_in (value , range , f"[FC] { attribute .__name__ } result ({ value } ) is invalid" )
111
111
112
- return value
112
+ return value
113
113
114
114
async def verify_attribute_invalid_in_state (self , attribute , init_value ) -> None :
115
115
value_current = await self .read_setting (attribute )
116
- asserts .assert_equal (value_current , init_value , f"[FC] Current { attribute .__name__ } value ({ value_current } ) must be equal to its initial value ({ init_value } )." )
116
+ asserts .assert_equal (value_current , init_value ,
117
+ f"[FC] Current { attribute .__name__ } value ({ value_current } ) must be equal to its initial value ({ init_value } )." )
117
118
118
119
def pics_TC_FAN_3_2 (self ) -> list [str ]:
119
120
return ["FAN.S" ]
@@ -155,7 +156,8 @@ async def test_TC_FAN_3_2(self):
155
156
init_percent_setting = await self .read_verify_setting (attributes .PercentSetting , Uint8Type , range (0 , 101 ))
156
157
init_percent_current = await self .read_verify_setting (attributes .PercentCurrent , Uint8Type , range (0 , 101 ))
157
158
init_fan_mode = await self .read_verify_setting (attributes .FanMode , fm_enum , [0 , 1 , 2 , 3 , 5 ])
158
- logging .info (f"[FC] Initial state - SpeedSetting: { init_speed_setting } , SpeedCurrent: { init_speed_current } , PercentSetting: { init_percent_setting } , PercentCurrent: { init_percent_current } , FanMode: { init_fan_mode } " )
159
+ logging .info (
160
+ f"[FC] Initial state - SpeedSetting: { init_speed_setting } , SpeedCurrent: { init_speed_current } , PercentSetting: { init_percent_setting } , PercentCurrent: { init_percent_current } , FanMode: { init_fan_mode } " )
159
161
160
162
# *** STEP 4 ***
161
163
# TH subscribes to the DUT's FanControl cluster
@@ -190,12 +192,12 @@ async def test_TC_FAN_3_2(self):
190
192
AttributeValue (self .endpoint , attributes .PercentSetting , percent_setting_expected ),
191
193
AttributeValue (self .endpoint , attributes .PercentCurrent , percent_setting_expected ),
192
194
AttributeValue (self .endpoint , attributes .FanMode , fan_mode_expected )
193
- ]
195
+ ]
194
196
self .attribute_subscription .await_all_final_values_reported (
195
197
expected_final_values = expected_values , timeout_sec = 1 )
196
198
197
199
# If the write operation returned CONSTRAINT_ERROR, verify that the SpeedSetting, SpeedCurrent,
198
- # PercentSetting, PercentCurrent, and FanMode attributes are the same as their initial values
200
+ # PercentSetting, PercentCurrent, and FanMode attributes are the same as their initial values
199
201
elif write_status == Status .ConstraintError :
200
202
await self .verify_attribute_invalid_in_state (attributes .FanMode , init_fan_mode )
201
203
await self .verify_attribute_invalid_in_state (attributes .SpeedSetting , init_speed_setting )
0 commit comments