Skip to content

Commit 29eba86

Browse files
cspurkdflemstr
authored andcommitted
Add test asserting that unpatched ZCL commands keep working
1 parent 6ed41bb commit 29eba86

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_schneiderelectric.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,26 @@ async def test_1gang_shutter_1_go_to_lift_percentage_cmd(zigpy_device_from_quirk
9191
assert request_mock.call_args[0][3] == 42 # 100 - 58
9292

9393

94+
async def test_1gang_shutter_1_unpatched_cmd(zigpy_device_from_quirk):
95+
"""Asserts that unpatched ZCL commands keep working."""
96+
97+
device = zigpy_device_from_quirk(
98+
zhaquirks.schneiderelectric.devices.shutters.OneGangShutter1
99+
)
100+
window_covering_cluster = device.endpoints[5].window_covering
101+
102+
p = mock.patch.object(window_covering_cluster, "request", mock.AsyncMock())
103+
with p as request_mock:
104+
request_mock.return_value = (foundation.Status.SUCCESS, "done")
105+
106+
await window_covering_cluster.up_open()
107+
108+
assert request_mock.call_count == 1
109+
assert request_mock.call_args[0][1] == (
110+
WindowCovering.ServerCommandDefs.up_open.id
111+
)
112+
113+
94114
async def test_1gang_shutter_1_lift_percentage_updates(zigpy_device_from_quirk):
95115
"""Asserts that updates to the ``current_position_lift_percentage`` attribute
96116
(e.g., by the device) invert the reported percentage value."""

0 commit comments

Comments
 (0)