Skip to content

Commit 23e6dda

Browse files
Added attribute_guard to OnMode attribute with DEPONOFF type.
1 parent e1f4e2d commit 23e6dda

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/python_testing/TC_MOD_1_2.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,18 @@ async def test_MOD_1_2(self):
135135
asserts.assert_in(current_mode, supported_modes_values, f"Current mode {current_mode} is not in {supported_modes_values}")
136136

137137
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)
148150
self.step(5)
149151
if await self.attribute_guard(endpoint=self.endpoint, attribute=self.cluster.Attributes.StartUpMode):
150152
startup_mode = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=self.cluster, attribute=self.cluster.Attributes.StartUpMode)

0 commit comments

Comments
 (0)