Skip to content

Commit 0ed1989

Browse files
committed
Adjust the code to send commands to comply with zigpy changes
1 parent 942d0cc commit 0ed1989

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

custom_components/zha_toolkit/zcl_cmd.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,30 @@ async def zcl_cmd(app, listener, ieee, cmd, data, service, params, event_data):
8686

8787
if (cluster_id == 5) and (cmd_id == 0):
8888
org_cluster_cmd_defs[0] = cluster.server_commands[0]
89+
command = foundation.ZCLCommandDev(
90+
name="zha_cltr5_cmd0",
91+
id=0x00,
92+
schema={
93+
"param1": t.uint16_t,
94+
"param2": t.uint8_t,
95+
"param3": t.uint16_t,
96+
"param4": t.CharacterString,
97+
"param5?": t.List[t.uint8_t],
98+
},
99+
).with_compiled_schema()
100+
89101
cluster.server_commands[0] = (
90102
"add",
91-
(
92-
t.uint16_t,
93-
t.uint8_t,
94-
t.uint16_t,
95-
t.CharacterString,
96-
t.Optional(t.List[t.uint8_t]),
97-
),
103+
command.schema,
98104
False,
99105
)
100106
elif cmd_id not in cluster.server_commands:
101107
cmd_schema: list[Any] = []
102108

103109
if cmd_args is not None:
104-
cmd_schema = [t.uint8_t] * len(cmd_args)
110+
cmd_schema = {
111+
f"param{i+1}?": t.uint8_t for i in range(len(cmd_args))
112+
}
105113

106114
cmd_def = foundation.ZCLCommandDef(
107115
name=f"zha_toolkit_dummy_cmd{cmd_id}",

hacs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"filename": "zha-toolkit.zip",
66
"render_readme": true,
77
"persistent_directory": "local",
8-
"homeassistant": "2024.9.0"
8+
"homeassistant": "2024.11.0"
99
}

0 commit comments

Comments
 (0)