Skip to content

Commit

Permalink
Update documentation to mention kwargs argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Dec 21, 2024
1 parent fa2e274 commit 0decc07
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ ZHA Toolkit can also:
- [`zcl_cmd` Example: "Store Scene"](#zcl_cmd-example-store-scene)
- [`zcl_cmd` Example: "Recall Scene"](#zcl_cmd-example-recall-scene)
- [`zcl_cmd` Example: "Add Scene"](#zcl_cmd-example-add-scene)
- [`zcl_cmd` Example: Pass keyword arguments](#zcl_cmd-example-pass-keyword-arguments)
- [Group related services](#group-related-services)
- [`add_group`](#add_group)
- [`get_groups`](#get_groups)
Expand Down Expand Up @@ -1422,6 +1423,24 @@ ZigBee Cluster Library Frame
Extension Set: 06000101
```

### `zcl_cmd` Example: Pass keyword arguments

`kwargs` allows passing arbitrary keyword arguments to the underlying ZHA
cluster command handler. For instance, this enables sending 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).

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

## Group related services

### `add_group`
Expand Down

0 comments on commit 0decc07

Please sign in to comment.