Skip to content

Commit 1a28055

Browse files
committed
Add annotations for async_update test
1 parent 5954cea commit 1a28055

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_cover.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,14 @@ async def test_cover(
289289
)
290290
assert entity.state["state"] == CoverState.OPEN
291291

292+
# test entity async_update
293+
cluster.PLUGGED_ATTR_READS[WCAttrs.current_position_lift_percentage.name] = 0
294+
cluster.PLUGGED_ATTR_READS[WCAttrs.current_position_tilt_percentage.name] = 0
295+
update_attribute_cache(cluster)
296+
await entity.async_update()
297+
await zha_gateway.async_block_till_done()
298+
assert entity.state["state"] == CoverState.OPEN
299+
292300
# close from client
293301
with patch("zigpy.zcl.Cluster.request", return_value=[0x1, zcl_f.Status.SUCCESS]):
294302
await entity.async_close_cover()
@@ -872,6 +880,7 @@ async def test_shade(
872880
)
873881
assert entity.state["state"] == CoverState.OPEN
874882

883+
# test entity async_update
875884
await entity.async_update()
876885
await zha_gateway.async_block_till_done()
877886
assert entity.state["state"] == CoverState.OPEN
@@ -1030,6 +1039,7 @@ async def test_keen_vent(
10301039
await send_attributes_report(zha_gateway, cluster_on_off, {8: 0, 0: False, 1: 1})
10311040
assert entity.state["state"] == CoverState.CLOSED
10321041

1042+
# test entity async_update
10331043
await entity.async_update()
10341044
await zha_gateway.async_block_till_done()
10351045
assert entity.state["state"] == CoverState.CLOSED

0 commit comments

Comments
 (0)