Skip to content

Commit

Permalink
Register endpoint with OTA input cluster on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Jun 11, 2020
1 parent 726cc42 commit d84a21b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def application(znp_server):
],
)

active_eps = [100, 12, 11, 8, 1]
active_eps = [100, 13, 12, 11, 8, 1]

znp_server.reply_to(
request=c.ZDO.ActiveEpReq.Req(DstAddr=0x0000, NWKAddrOfInterest=0x0000),
Expand Down Expand Up @@ -320,7 +320,7 @@ async def test_application_startup_endpoints(application):

await app.startup(auto_form=False)

assert len(endpoints) == 5
assert len(endpoints) == 6


@pytest_mark_asyncio_timeout(seconds=5)
Expand Down
8 changes: 6 additions & 2 deletions zigpy_znp/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

from zigpy.zdo.types import ZDOCmd, ZDOHeader, CLUSTERS as ZDO_CLUSTERS

from zigpy.zcl import clusters
from zigpy.types import ExtendedPanId, deserialize as list_deserialize
from zigpy.zcl.clusters.security import IasZone
from zigpy.exceptions import DeliveryError

import zigpy_znp.config as conf
Expand Down Expand Up @@ -394,10 +394,14 @@ async def startup(self, auto_form=False):
await self._register_endpoint(
endpoint=8,
device_id=zigpy.profiles.zha.DeviceType.IAS_CONTROL,
output_clusters=[IasZone.cluster_id],
output_clusters=[clusters.security.IasZone.cluster_id],
)
await self._register_endpoint(endpoint=11)
await self._register_endpoint(endpoint=12)
await self._register_endpoint(
endpoint=13, input_clusters=[clusters.general.Ota.cluster_id]
)

await self._register_endpoint(
endpoint=100, profile_id=zigpy.profiles.zll.PROFILE_ID, device_id=0x0005
)
Expand Down

0 comments on commit d84a21b

Please sign in to comment.