diff --git a/zigpy_xbee/__init__.py b/zigpy_xbee/__init__.py index 611857f..800504f 100644 --- a/zigpy_xbee/__init__.py +++ b/zigpy_xbee/__init__.py @@ -1,5 +1,5 @@ MAJOR_VERSION = 0 MINOR_VERSION = 18 -PATCH_VERSION = "1" +PATCH_VERSION = "2" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" diff --git a/zigpy_xbee/zigbee/application.py b/zigpy_xbee/zigbee/application.py index 8c4db1b..4b680df 100644 --- a/zigpy_xbee/zigbee/application.py +++ b/zigpy_xbee/zigbee/application.py @@ -103,6 +103,8 @@ async def start_network(self): self.listener_event("raw_device_initialized", xbee_dev) self.devices[dev.ieee] = xbee_dev + await self.register_endpoints() + async def load_network_info(self, *, load_devices=False): # Load node info node_info = self.state.node_info @@ -186,10 +188,15 @@ async def force_remove(self, dev): """Forcibly remove device from NCP.""" pass - async def add_endpoint(self, descriptor): + async def add_endpoint(self, descriptor: zdo_t.SimpleDescriptor) -> None: """Register a new endpoint on the device.""" - # This is not provided by the XBee API - pass + self._device.replacement["endpoints"][descriptor.endpoint] = { + "device_type": descriptor.device_type, + "profile_id": descriptor.profile, + "input_clusters": descriptor.input_clusters, + "output_clusters": descriptor.output_clusters, + } + self._device.add_endpoint(descriptor.endpoint) async def _get_association_state(self): """Wait for Zigbee to start."""