From 4ba2bd232c4d02e7c80e7f7efff34a17cd0fe3ab Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Wed, 20 Nov 2019 08:34:06 -0500 Subject: [PATCH] Command arguments for issue_zigbee_cluster_commands. (#28885) --- homeassistant/components/zha/api.py | 4 ++-- homeassistant/components/zha/core/device.py | 3 +-- homeassistant/components/zha/services.yaml | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/zha/api.py b/homeassistant/components/zha/api.py index f2fbc126e6e..438b93244cf 100644 --- a/homeassistant/components/zha/api.py +++ b/homeassistant/components/zha/api.py @@ -141,7 +141,7 @@ SERVICE_SCHEMAS = { vol.Optional(ATTR_CLUSTER_TYPE, default=CLUSTER_TYPE_IN): cv.string, vol.Required(ATTR_COMMAND): cv.positive_int, vol.Required(ATTR_COMMAND_TYPE): cv.string, - vol.Optional(ATTR_ARGS, default=""): cv.string, + vol.Optional(ATTR_ARGS, default=[]): cv.ensure_list, vol.Optional(ATTR_MANUFACTURER): cv.positive_int, } ), @@ -649,7 +649,7 @@ def async_load_api(hass): cluster_id, command, command_type, - args, + *args, cluster_type=cluster_type, manufacturer=manufacturer, ) diff --git a/homeassistant/components/zha/core/device.py b/homeassistant/components/zha/core/device.py index b3be8037ff6..e5d1678ad6f 100644 --- a/homeassistant/components/zha/core/device.py +++ b/homeassistant/components/zha/core/device.py @@ -479,7 +479,7 @@ class ZHADevice(LogMixin): cluster_id, command, command_type, - args, + *args, cluster_type=CLUSTER_TYPE_IN, manufacturer=None, ): @@ -487,7 +487,6 @@ class ZHADevice(LogMixin): cluster = self.async_get_cluster(endpoint_id, cluster_id, cluster_type) if cluster is None: return None - response = None if command_type == CLUSTER_COMMAND_SERVER: response = await cluster.command( command, *args, manufacturer=manufacturer, expect_reply=True diff --git a/homeassistant/components/zha/services.yaml b/homeassistant/components/zha/services.yaml index d556c279d3c..ab8e9c19580 100644 --- a/homeassistant/components/zha/services.yaml +++ b/homeassistant/components/zha/services.yaml @@ -78,7 +78,7 @@ issue_zigbee_cluster_command: example: "server" args: description: args to pass to the command - example: {} + example: '[arg1, arg2, argN]' manufacturer: description: manufacturer code example: 0x00FC @@ -98,7 +98,7 @@ issue_zigbee_group_command: example: 0 args: description: args to pass to the command - example: {} + example: '[arg1, arg2, argN]' manufacturer: description: manufacturer code example: 0x00FC