zigpy / zigpy-znp

TI CC2531, CC13x2, CC26x2 radio support for Zigpy and ZHA
GNU General Public License v3.0
150 stars 40 forks source link

Unhandled entry type 4 in read_devices #254

Closed flonou closed 3 weeks ago

flonou commented 2 months ago

Hi,

When trying to create a backup in home-assistant it fails due to what seems to be a unmanaged AddrMgrUserType case in zigpy-znp.

The traceback is here :

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/backup/websocket.py", line 76, in handle_create backup = await manager.generate_backup() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 199, in generate_backup await self.pre_backup_actions() File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 101, in pre_backup_actions raise result File "/usr/src/homeassistant/homeassistant/components/zha/backup.py", line 23, in async_pre_backup await zha_gateway.application_controller.backups.create_backup(load_devices=True) File "/usr/local/lib/python3.12/site-packages/zigpy/backups.py", line 143, in create_backup await self.app.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_znp/zigbee/application.py", line 144, in load_network_info await self._znp.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_znp/api.py", line 239, in load_network_info await self._load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.12/site-packages/zigpy_znp/api.py", line 214, in _load_network_info for dev in await security.read_devices(self, tclk_seed=tclk_seed): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy_znp/znp/security.py", line 292, in read_devices raise ValueError(f"Unexpected entry type: {entry.type}") ValueError: Unexpected entry type: 4

It seems like entry type 4 is Binding = 0x04

which is indeed not handled in read_devices