Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing keyword arguments in zcl_cmd #270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

extinctpotato
Copy link

This PR adds a new parameter to the zcl_cmd service that allows passing arbitrary keyword arguments to the underlying ZHA cluster command handler. I needed it to be able to send an IR remote code to the cluster command handler in the Tuya TS1201 quirk (see https://github.com/ferehcarb/zha-device-handlers/blob/fd90c398bd746df22a5cd55e53cd3134fbd7e009/zhaquirks/tuya/ts1201.py#L125).

This is what the usage of the parameter looks like in practice:

action: zha_toolkit.zcl_cmd
metadata: {}
data:
  ieee: switch.ir_blaster_switch
  cluster: 57348
  cmd: 2
  kwargs:
    code: BXcjrhE/AuATAQF+BuAVA8AB4Acn4AMBQBvgBwFAE8ADB92ZdyPMCD8C

While implementing it, I had a constant feeling that I was overlooking something and that perhaps there was a way to pass kwargs without making modifications to zha-toolkit. If that is the case, I'd be glad if somebody shared how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant