Skip to content

Commit

Permalink
Limitation of zigpy, check if tries present in cluster.command parame…
Browse files Browse the repository at this point in the history
…ter list
  • Loading branch information
mdeweerd committed Jan 24, 2022
1 parent 196433e commit b176889
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions custom_components/zha_toolkit/zcl_cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import inspect

from . import utils as u

Expand Down Expand Up @@ -104,13 +105,21 @@ async def zcl_cmd(app, listener, ieee, cmd, data, service, event_data={}, params
),
False,
)
await cluster.command(
cmd_id,
*cmd_args,
manufacturer=manf,
expect_reply=expect_reply,
tries=tries,
)
if "tries" in inspect.getfullargspec(cluster.command)[0]:
await cluster.command(
cmd_id,
*cmd_args,
manufacturer=manf,
expect_reply=expect_reply,
tries=tries,
)
else:
await cluster.command(
cmd_id,
*cmd_args,
manufacturer=manf,
expect_reply=expect_reply,
)
else:
if cluster_id not in endpoint.out_clusters:
msg = ERR005_NOT_OUT_CLUSTER.format(cluster_id, repr(ieee), ep_id)
Expand Down

0 comments on commit b176889

Please sign in to comment.