|
4 | 4 | import zigpy.zdo
|
5 | 5 | import zigpy.endpoint
|
6 | 6 | import zigpy.profiles
|
7 |
| -from zigpy.zdo.types import ZDOCmd, SizePrefixedSimpleDescriptor |
| 7 | +from zigpy.zdo.types import ZDOCmd |
8 | 8 | from zigpy.exceptions import DeliveryError
|
9 | 9 |
|
10 | 10 | import zigpy_znp.types as t
|
|
15 | 15 | from ..conftest import FORMED_DEVICES, CoroutineMock, FormedLaunchpadCC26X2R1
|
16 | 16 |
|
17 | 17 |
|
18 |
| -@pytest.mark.parametrize("device", FORMED_DEVICES) |
19 |
| -async def test_zdo_request_interception(device, make_application): |
20 |
| - app, znp_server = make_application(server_cls=device) |
21 |
| - await app.startup(auto_form=False) |
22 |
| - |
23 |
| - device = app.add_initialized_device(ieee=t.EUI64(range(8)), nwk=0xFA9E) |
24 |
| - |
25 |
| - # Send back a request response |
26 |
| - active_ep_req = znp_server.reply_once_to( |
27 |
| - request=c.ZDO.SimpleDescReq.Req( |
28 |
| - DstAddr=device.nwk, NWKAddrOfInterest=device.nwk, Endpoint=1 |
29 |
| - ), |
30 |
| - responses=[ |
31 |
| - c.ZDO.SimpleDescReq.Rsp(Status=t.Status.SUCCESS), |
32 |
| - c.ZDO.SimpleDescRsp.Callback( |
33 |
| - Src=device.nwk, |
34 |
| - Status=t.ZDOStatus.SUCCESS, |
35 |
| - NWK=device.nwk, |
36 |
| - SimpleDescriptor=SizePrefixedSimpleDescriptor( |
37 |
| - *dict( |
38 |
| - endpoint=1, |
39 |
| - profile=49246, |
40 |
| - device_type=256, |
41 |
| - device_version=2, |
42 |
| - input_clusters=[0, 3, 4, 5, 6, 8, 2821, 4096], |
43 |
| - output_clusters=[5, 25, 32, 4096], |
44 |
| - ).values() |
45 |
| - ), |
46 |
| - ), |
47 |
| - ], |
48 |
| - ) |
49 |
| - |
50 |
| - status, message = await app.request( |
51 |
| - device=device, |
52 |
| - profile=260, |
53 |
| - cluster=ZDOCmd.Simple_Desc_req, |
54 |
| - src_ep=0, |
55 |
| - dst_ep=0, |
56 |
| - sequence=1, |
57 |
| - data=b"\x01\x9e\xfa\x01", |
58 |
| - use_ieee=False, |
59 |
| - ) |
60 |
| - |
61 |
| - assert status == t.Status.SUCCESS |
62 |
| - await active_ep_req |
63 |
| - |
64 |
| - await app.shutdown() |
65 |
| - |
66 |
| - |
67 | 18 | @pytest.mark.parametrize("device", FORMED_DEVICES)
|
68 | 19 | async def test_chosen_dst_endpoint(device, make_application, mocker):
|
69 | 20 | app, znp_server = make_application(device)
|
@@ -91,7 +42,7 @@ async def test_zigpy_request(device, make_application):
|
91 | 42 | app, znp_server = make_application(device)
|
92 | 43 | await app.startup(auto_form=False)
|
93 | 44 |
|
94 |
| - TSN = 6 |
| 45 | + TSN = 7 |
95 | 46 |
|
96 | 47 | device = app.add_initialized_device(ieee=t.EUI64(range(8)), nwk=0xAABB)
|
97 | 48 |
|
@@ -151,7 +102,7 @@ async def test_zigpy_request_failure(device, make_application, mocker):
|
151 | 102 | app, znp_server = make_application(device)
|
152 | 103 | await app.startup(auto_form=False)
|
153 | 104 |
|
154 |
| - TSN = 6 |
| 105 | + TSN = 7 |
155 | 106 |
|
156 | 107 | device = app.add_initialized_device(ieee=t.EUI64(range(8)), nwk=0xAABB)
|
157 | 108 |
|
|
0 commit comments