-
Notifications
You must be signed in to change notification settings - Fork 41
Removing device from the network doesn't remove device from the database #17
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
Comments
The device initially didn't respond to the ZDO leave request so Zigpy used In either case, Zigpy's At the end, the device is popped from the dictionary of known devices and and self.devices.pop(ieee, None)
self.listener_event("device_removed", dev) The ZHA component handles the Zigpy event: def device_removed(self, device):
"""Handle device being removed from the network."""
zha_device = self._devices.pop(device.ieee, None)
entity_refs = self._device_registry.pop(device.ieee, None)
if zha_device is not None:
device_info = zha_device.zha_device_info
zha_device.async_cleanup_handles()
async_dispatcher_send(
self._hass, "{}_{}".format(SIGNAL_REMOVE, str(zha_device.ieee))
)
asyncio.ensure_future(self._async_remove_device(zha_device, entity_refs))
if device_info is not None:
async_dispatcher_send(
self._hass,
ZHA_GW_MSG,
{
ATTR_TYPE: ZHA_GW_MSG_DEVICE_REMOVED,
ZHA_GW_MSG_DEVICE_INFO: device_info,
},
) I don't see any reference to |
It does makes sense, but I have strong suspicion it never gets to https://github.com/zigpy/zigpy/blob/b76922c9591f743aa8982809c812fd60113ca975/zigpy/application.py#L141-L143 on unrelated note: what's the timeout when there's no response?
Is it 15s? |
While a bit non-standard, if you can call You could also change |
I don't get why with ZNP they have a separate ZDO interface. |
I think that's what the response callback is for, since it's not always delivered: https://github.com/zha-ng/zigpy-znp/blob/e6d78b26c1b7ea4337ade6235ad6f259346ef20c/zigpy_znp/zigbee/application.py#L36-L78 If you don't use their ZDO commands, Z-Stack still intercepts the message but either sends back a named callback or nothing at all. |
so the
Is this a response/confirmation that far end received the message (TX confirm in other radios) or is it just indication that ZNP stack received the request? |
It's just a confirmation from Z-Stack. The response would be the |
Removing device from the network doesn't remove device from the internal database/device list.
Here's log of device being removed two times. The device does receive the leave request and leaves the network, but it seems it still being kept in the
ControllerApplication.devices
dict.On the second "device removed" I was expecting to see "device not found" message
The text was updated successfully, but these errors were encountered: