-
Notifications
You must be signed in to change notification settings - Fork 18
Call Handle join when device changes nwk #25
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
Conversation
Remove existing nwk from registry prior to adding new nwk
self._devices_by_nwk[src_nwk] = src_ieee | ||
self.handle_join(src_nwk, ember_ieee, 0) # TODO: Parent nwk | ||
device = self.get_device(ember_ieee) | ||
if device.nwk != src_nwk: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to conflate line 131 if block and line 134 if block. IEEE never changes, but if src_nwk not in self._devices_by_nwk
then either NWK has changed or it is a new device. In both cases we should self.handle_join()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If statements conflated. Do we still want to remove the original nwk?
Frankly, I'm not a fan of the current "new device join" handling. I like how it was implemented in |
I've been running fixes/update-nwk-change for awhile and I'm seeing issues where xiaomi devices are losing their quirks and have to be removed and re-added if the system restarts. It's not all devices, but usually 1- 6 of them will be corrupted after restarting. I pulled the latest dev version of Home Assistant, which is supposed to fix the issue, but they are still corrupted upon restart. I'm seeing traffic like this in the logs and think it may be related. Are you seeing similar traffic, the ieee is odd to me.
|
Yes, indeed there was a problem, however not in HA, but in zigpy #107 make sure you are running the zigpy version. And I need to rebase this PR. |
When the nwk of an existing device in the registry changes, handle_join isn't called. This ensures that handle_join is called when the nwk is changed and that the old entry is removed and replaced. Similar PR in zigpy: zigpy/bellows@4cf1237#diff-a03328e8d311484ecec5cd5f4129ab49