Allow passing keyword arguments in zcl_cmd
#270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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 tozha-toolkit
. If that is the case, I'd be glad if somebody shared how.