Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/application/test_joining.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def test_permit_join(device, mocker, make_application):
request=zdo_request_matcher(
dst_addr=t.AddrModeAddress(t.AddrMode.Broadcast, 0xFFFC),
command_id=zdo_t.ZDOCmd.Mgmt_Permit_Joining_req,
TSN=2,
TSN=4, # zigpy sends a Green Power commissioning broadcast first (TSN 3)
zdo_PermitDuration=10,
zdo_TC_Significant=0,
),
Expand Down
5 changes: 3 additions & 2 deletions tests/application/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ async def test_endpoints(device, make_application):

await app.startup(auto_form=False)

# We currently just register two endpoints
assert len(endpoints) == 2
# We register the two application endpoints and zigpy's Green Power endpoint
assert len(endpoints) == 3
assert 1 in app._device.endpoints
assert 2 in app._device.endpoints
assert 242 in app._device.endpoints

await app.shutdown()

Expand Down
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,16 @@ def permit_join(self, request):
c.ZDO.MgmtPermitJoinRsp.Callback(Src=0x0000, Status=t.ZDOStatus.SUCCESS),
]

@reply_to(
c.AF.DataRequestExt.Req(
partial=True, DstEndpoint=242, SrcEndpoint=242, ClusterId=0x0021
)
)
def on_green_power_broadcast(self, req):
# Newer zigpy sends a Green Power broadcast (e.g. a commissioning window
# request) to the GP endpoint. Just acknowledge it.
return c.AF.DataRequestExt.Rsp(Status=t.Status.SUCCESS)

@reply_to(c.AF.DataRequestExt.Req(partial=True, DstEndpoint=0))
def on_zdo_request(self, req):
kwargs = deserialize_zdo_command(req.ClusterId, req.Data[1:])
Expand Down
Loading