-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement new zigpy radio API #123
Conversation
64c6b24
to
0921561
Compare
@Adminiuga @Shulyaka could you test this PR out with some real XBee hardware? All of the dependencies are backwards compatible with ZHA so it's expected to "just work" and log some extra info on startup: pip install \
git+https://github.com/puddly/zigpy.git@puddly/new-radio-settings-api \
git+https://github.com/puddly/zigpy-cli.git@puddly/zigpy-radio-api \
git+https://github.com/puddly/zigpy-znp.git@puddly/new-radio-settings-api \
git+https://github.com/puddly/zigpy-deconz.git@puddly/new-radio-api \
git+https://github.com/puddly/zigpy-xbee.git@puddly/new-radio-api \
git+https://github.com/puddly/zigpy-zigate.git@puddly/new-radio-api \
git+https://github.com/puddly/bellows.git@puddly/zigpy-radio-api
hass --skip-pip # so HA doesn't downgrade the deps on startup |
Hi @puddly What do you want us to test? Just normal operations or some specific test cases? |
The only notable changes are to network formation, detecting when a network is not formed, and reading out network settings (the few that the XBee command set allows you to read). |
Hi @puddly
For comparison, here is the startup sequence for the core code (also looks shorter):
|
Thanks for the feedback, I appreciate it! You're totally right about the joins. Zigpy now calls
Is there a way to disable joins without having to enable them for one second? |
It is disabling joins by calling NJ0. Twice, actually (!). But later it calls CB2 (Commissioning Pushbutton) which basically enables joins back. |
Like this? async def permit_ncp(self, time_s=60):
assert 0 <= time_s <= 254
await self._api._at_command("NJ", time_s)
await self._api._at_command("AC")
- await self._api._at_command("CB", 2)
+
+ if time_s > 0:
+ await self._api._at_command("CB", 2) |
Just remove the CB, just setting NJ with AC is enough if I am reading the manual correctly:
So we only need one of the 3. |
Untested implementation of zigpy/zigpy#848
The XBee API doesn't allow for any interesting data to be read from the coordinator (i.e. network key, frame counters, child tables) so unfortunately backup for this platform won't be possible for existing networks. Maybe the help of a second radio in router/end device mode...