def get_command_input_param_names(self, to, requested_command_id):
"""
Given an item ID and a command ID, requests the parameter names of the command from the item.
Returns a list of names (comma delimited) that represent the parameter names.
TODO: change return value to string?
Eg. "frequency,duty cycle"
:param to: destination item ID
:param requested_command_id: command id to find the parameter names of
:return: a list of parameter names
"""
try:
response = yield self.send_command(to, command_id=GET_COMMAND_INPUT_PARAM_NAMES, params=["command_id"],
data=[requested_command_id])
except Exception as e:
logger.error("[PCOM] Unable to find command input parameter names for command {0} in item {1} because of "
"exception: {2}".format(requested_command_id, to, e))
defer.returnValue(None)
param_names = [] if len(response.data) == 0 else [x.strip() for x in response.data[0].split(',')]
defer.returnValue(param_names)
评论列表
文章目录