From 0decc0714188ab2e69bc4571e3d639d107176a5a Mon Sep 17 00:00:00 2001 From: mdeweerd Date: Sat, 21 Dec 2024 20:09:23 +0100 Subject: [PATCH] Update documentation to mention kwargs argument --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index cfe98c0..9808f4d 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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`