Skip to content

Commit 46fc23a

Browse files
committed
Simplify endpoints
1 parent 3497f79 commit 46fc23a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

tests/test_application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def application(znp_server):
181181
],
182182
)
183183

184-
active_eps = [100, 13, 12, 11, 8, 1]
184+
active_eps = [100, 2, 1]
185185

186186
znp_server.reply_to(
187187
request=c.ZDO.ActiveEpReq.Req(DstAddr=0x0000, NWKAddrOfInterest=0x0000),
@@ -359,7 +359,7 @@ async def test_application_startup_endpoints(application):
359359

360360
await app.startup(auto_form=False)
361361

362-
assert len(endpoints) == 6
362+
assert len(endpoints) == 3
363363

364364

365365
@pytest_mark_asyncio_timeout(seconds=5)

zigpy_znp/zigbee/application.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,19 @@ async def startup(self, auto_form=False):
405405
c.AF.Delete.Req(Endpoint=endpoint), RspStatus=t.Status.SUCCESS
406406
)
407407

408-
# Register our endpoints
409-
await self._register_endpoint(endpoint=1)
410408
await self._register_endpoint(
411-
endpoint=8,
412-
device_id=zigpy.profiles.zha.DeviceType.IAS_CONTROL,
413-
output_clusters=[clusters.security.IasZone.cluster_id],
409+
endpoint=1,
410+
profile_id=zigpy.profiles.zha.PROFILE_ID,
411+
input_clusters=[clusters.general.Ota.cluster_id],
414412
)
415-
await self._register_endpoint(endpoint=11)
416-
await self._register_endpoint(endpoint=12)
413+
417414
await self._register_endpoint(
418-
endpoint=13, input_clusters=[clusters.general.Ota.cluster_id]
415+
endpoint=2,
416+
device_id=zigpy.profiles.zha.DeviceType.IAS_CONTROL,
417+
output_clusters=[
418+
clusters.security.IasZone.cluster_id,
419+
clusters.security.IasWd.cluster_id,
420+
],
419421
)
420422

421423
await self._register_endpoint(
@@ -540,7 +542,7 @@ async def form_network(self):
540542
reset=False,
541543
)
542544

543-
# We want to receive all ZDO callbacks to proxy them back go zipgy
545+
# We want to receive all ZDO callbacks to proxy them back to zipgy
544546
await self._znp.nvram_write(NwkNvIds.ZDO_DIRECT_CB, t.Bool(True))
545547

546548
# Reset now so that the changes take effect

0 commit comments

Comments
 (0)