diff --git a/zigpy_znp/commands/zdo.py b/zigpy_znp/commands/zdo.py index 9768e4e4..ae62f8a8 100644 --- a/zigpy_znp/commands/zdo.py +++ b/zigpy_znp/commands/zdo.py @@ -100,16 +100,7 @@ class GroupIdList(t.LVList, item_type=t.GroupId, length_type=t.uint8_t): pass -class BindEntry(t.Struct): - """Bind table entry.""" - - Src: t.EUI64 - SrcEp: t.uint8_t - ClusterId: t.ClusterId - DstAddr: zigpy.zdo.types.MultiAddress - - -class BindEntryList(t.LVList, item_type=BindEntry, length_type=t.uint8_t): +class BindEntryList(t.LVList, item_type=zigpy.zdo.types.Binding, length_type=t.uint8_t): pass @@ -1209,8 +1200,8 @@ class ZDO(t.CommandsBase, subsystem=t.Subsystem.ZDO): t.uint8_t, "Total number of entries available on the device", ), - t.Param("Index", t.uint8_t, "Index where the response starts"), - t.Param("BindTable", BindEntryList, "list of BindEntries"), + t.Param("StartIndex", t.uint8_t, "Index where the response starts"), + t.Param("BindTableList", BindEntryList, "list of BindEntries"), ), ) diff --git a/zigpy_znp/zigbee/zdo_converters.py b/zigpy_znp/zigbee/zdo_converters.py index 33d6719e..a9bcfd48 100644 --- a/zigpy_znp/zigbee/zdo_converters.py +++ b/zigpy_znp/zigbee/zdo_converters.py @@ -191,4 +191,26 @@ (lambda addr: c.ZDO.MgmtRtgRsp.Callback(partial=True, Src=addr.address)), (lambda rsp: (ZDOCmd.Mgmt_Rtg_rsp, {"Status": rsp.Status})), ), + ZDOCmd.Mgmt_Bind_req: ( + ( + lambda addr, StartIndex: ( + c.ZDO.MgmtBindReq.Req( + Dst=addr.address, + StartIndex=StartIndex, + ) + ) + ), + (lambda addr: c.ZDO.MgmtBindRsp.Callback(partial=True, Src=addr.address)), + ( + lambda rsp: ( + ZDOCmd.Mgmt_Bind_rsp, + { + "Status": rsp.Status, + "BindingTableEntries": rsp.BindTableEntries, + "StartIndex": rsp.StartIndex, + "BindingTableList": rsp.BindTableList, + }, + ) + ), + ), }