kardia-as / zigpy-zboss

GNU General Public License v3.0
36 stars 4 forks source link

Fix ieee add request #42

Closed DamKast closed 4 months ago

DamKast commented 4 months ago

Closes #41

This PR is fixing the fact that the database is not updated when a device changes its NWK address.

puddly commented 4 months ago

The zigpy application interface doesn't expect radio libraries themselves to override low-level methods such as _discover_unknown_device because we expect commands such as zigpy.zdo.broadcast to work.

Is there any way to customize ZBOSS firmware or otherwise handle ZDO packet sending/receiving entirely within send_packet and packet_received so that zigpy-zboss does not inject itself into the zigpy stack by modifying Device objects and overriding core methods?

DamKast commented 4 months ago

I updated the code to avoid the _discover_unknown_device method rewrite. When a broadcast packet is sent to the application controller using the radio application send_packet method, I check if the packet is a ZDO IEEE_addr_req packet. If it is, then I'll send the ZBOSS specific ZDO request and call packet_received with a reconstructed ZDO packet.

Does that look better to you? @puddly