@@ -135,16 +135,18 @@ async def test_MOD_1_2(self):
135
135
asserts .assert_in (current_mode , supported_modes_values , f"Current mode { current_mode } is not in { supported_modes_values } " )
136
136
137
137
self .step (4 )
138
- on_mode = await self .read_single_attribute_check_success (endpoint = self .endpoint , cluster = self .cluster , attribute = self .cluster .Attributes .OnMode )
139
- # On mode can be Nullvalue
140
- self ._log_attribute ("OnMode" , on_mode )
141
- asserts .assert_true ((isinstance (on_mode , int ) or on_mode is NullValue ),
142
- "Onmode is not int or is not Nullvalue" )
143
- # Verify that OnMode is in the list of Supported Modes, but if null, cant be verified.
144
- if on_mode is not NullValue :
145
- asserts .assert_in (on_mode , supported_modes_values , f"Onmode { on_mode } is not in { supported_modes_values } " )
146
-
147
- # Validate startup mode ( attribute Startup is optional)
138
+ # DEPONOFF in the Mandatory/Optional Column
139
+ if await self .attribute_guard (endpoint = self .endpoint , attribute = self .cluster .Attributes .OnMode ):
140
+ on_mode = await self .read_single_attribute_check_success (endpoint = self .endpoint , cluster = self .cluster , attribute = self .cluster .Attributes .OnMode )
141
+ # On mode can be Nullvalue
142
+ self ._log_attribute ("OnMode" , on_mode )
143
+ asserts .assert_true ((isinstance (on_mode , int ) or on_mode is NullValue ),
144
+ "Onmode is not int or is not Nullvalue" )
145
+ # Verify that OnMode is in the list of Supported Modes, but if null, cant be verified.
146
+ if on_mode is not NullValue :
147
+ asserts .assert_in (on_mode , supported_modes_values , f"Onmode { on_mode } is not in { supported_modes_values } " )
148
+
149
+ # Validate startup mode (attribute Startup is optional)
148
150
self .step (5 )
149
151
if await self .attribute_guard (endpoint = self .endpoint , attribute = self .cluster .Attributes .StartUpMode ):
150
152
startup_mode = await self .read_single_attribute_check_success (endpoint = self .endpoint , cluster = self .cluster , attribute = self .cluster .Attributes .StartUpMode )
0 commit comments