Skip to content

Commit 6249885

Browse files
authored
register zigpy endpoints at startup (#145)
1 parent 6485f59 commit 6249885

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

zigpy_xbee/zigbee/application.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ async def start_network(self):
103103
self.listener_event("raw_device_initialized", xbee_dev)
104104
self.devices[dev.ieee] = xbee_dev
105105

106+
await self.register_endpoints()
107+
106108
async def load_network_info(self, *, load_devices=False):
107109
# Load node info
108110
node_info = self.state.node_info
@@ -186,10 +188,15 @@ async def force_remove(self, dev):
186188
"""Forcibly remove device from NCP."""
187189
pass
188190

189-
async def add_endpoint(self, descriptor):
191+
async def add_endpoint(self, descriptor: zdo_t.SimpleDescriptor) -> None:
190192
"""Register a new endpoint on the device."""
191-
# This is not provided by the XBee API
192-
pass
193+
self._device.replacement["endpoints"][descriptor.endpoint] = {
194+
"device_type": descriptor.device_type,
195+
"profile_id": descriptor.profile,
196+
"input_clusters": descriptor.input_clusters,
197+
"output_clusters": descriptor.output_clusters,
198+
}
199+
self._device.add_endpoint(descriptor.endpoint)
193200

194201
async def _get_association_state(self):
195202
"""Wait for Zigbee to start."""

0 commit comments

Comments
 (0)