Repository navigation
Conversation
|
Thanks! Does the xbee have an API to register new endpoints? Zigpy radio libraries should implement the |
| if 1 not in self._device.endpoints: | ||
| self._device.add_endpoint(1) | ||
|
|
||
| cluster = self._device.endpoints[1].add_input_cluster( | ||
| zigpy.zcl.clusters.general.Basic.cluster_id | ||
| ) |
There was a problem hiding this comment.
No, it does not, however I believe new endpoints can be implemented on the application level.
If you feel uncomfortable adding an endpoint, we could instead pick the first existing one like this:
| if 1 not in self._device.endpoints: | |
| self._device.add_endpoint(1) | |
| cluster = self._device.endpoints[1].add_input_cluster( | |
| zigpy.zcl.clusters.general.Basic.cluster_id | |
| ) | |
| cluster = self._device.non_zdo_endpoints[0].add_input_cluster( | |
| zigpy.zcl.clusters.general.Basic.cluster_id | |
| ) |
Please advise.
There was a problem hiding this comment.
Perhaps it would be best for the XBee implementation to call await self.register_endpoints() within start_network and then to implement register_endpoint to just call add_endpoint. This is more of a radio library bug more than a zigpy bug, in my opinion.
There was a problem hiding this comment.
Is endpoint 1 mandatory or is zigpy just making an assumption?
There was a problem hiding this comment.
Yes. Zigpy registers endpoints explicitly on startup:
Line 701 in 32a3f05
There was a problem hiding this comment.
Thanks! I will check.
|
Updated. It looks like a more clean solution |
|
Closed in favor of zigpy/zigpy-xbee#145 and zigpy/zigpy-zigate#146. UPD: Do we also need a similar fix for zigpy_deconz? |
On #1238 we add Basic cluster to endpoint 1.
This PR makes sure that that endpoint actually exists.
Mostly applicable to xbee coordinators: https://github.com/zigpy/zigpy-xbee/blob/dev/zigpy_xbee/zigbee/application.py#L381