mdeweerd / zha-toolkit

🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant
GNU General Public License v3.0
190 stars 26 forks source link

🧰 ZHA Toolkit: Get Binding Table not working #212

Closed rkuijer closed 11 months ago

rkuijer commented 11 months ago

When I try to get the binds from a device I get always the following error: I can

Service call: service: zha_toolkit.binds_get data: ieee: xx:xx:xx:xx:xx event_done: event_binds_get_done tries: 100

Error: Logger: custom_components.zha_toolkit Source: custom_components/zha_toolkit/__init__.py:817 Integration: 🧰 ZHA Toolkit ([documentation](https://github.com/mdeweerd/zha-toolkit), [issues](https://github.com/mdeweerd/zha-toolkit/issues)) First occurred: 10:42:34 (1 occurrences) Last logged: 10:42:34 Exception ''coroutine' object has no attribute 'zdo'' for service call with data '{'zha_toolkit_version': 'v1.1.4', 'zigpy_version': '0.59.0', 'zigpy_rf_version': '0.36.8', 'ieee_org': xx:xx:xx:xx:xx, 'ieee': 'xx:xx:xx:xx:xx', 'command': 'binds_get', 'command_data': None, 'start_time': '2023-11-03T09:42:34.341949+00:00', 'errors': ['AttributeError("\'coroutine\' object has no attribute \'zdo\'")'], 'params': {'dir': 0, 'tries': 100, 'expect_reply': True, 'args': [], 'event_done': 'event_binds_get_done', 'read_before_write': True, 'read_after_write': True}, 'success': False}'

The following service call is OK so I'm not suspecting the toolkit installation itself: service: zha_toolkit.attr_read data: ieee: 00:17:88:01:10:29:5e:e7 cluster: 0 attribute: 0

HA environment: Core 2023.11.0 Supervisor 2023.10.1 Operating System 11.1 Frontend 20231030.1

Any idea what's the cause of this error? home-assistant_2023-11-03T09-43-21.396Z.log

mdeweerd commented 11 months ago

This could a breaking change in zigpy (as you are on 2023.11.0).

zha-toolkit hooks into some of the internals of zigpy to do its work, so when these internals change, zha-toolkit breaks.

However, I still see zdo as an attribute on the Device class: https://github.com/zigpy/zigpy/blob/dev/zigpy/device.py#L64

I suspect a bug I introduced in a recent change - I am going to check that out.

mdeweerd commented 11 months ago

Should be fixed in v1.1.5

rkuijer commented 11 months ago

Working like a charm! Thanks for the quick response.