action 为设备侧识别的唯一指令名,命名规范见 DevicePluginCreateRequest.action 字段说明。Authorization: ********************{
"name": "开灯",
"description": "打开设备指示灯",
"action": "turn_on_light",
"input_params": [
{
"name": "brightness",
"type": "integer",
"description": "亮度 0-100",
"required": false,
"default_value": "80"
}
],
"return_params": [
{
"name": "success",
"type": "boolean",
"description": "是否执行成功",
"required": true
}
]
}curl --location 'https://openapi-cn01.tange365.com/ai/aigcrtc/device/plugins' \
--header 'X-Tg-App-Id;' \
--header 'X-Tg-App-Id: {{app-id}}' \
--header 'X-Tg-Platform: {{platform}}' \
--header 'X-Tg-Platform: {{platform}}' \
--header 'X-Tg-Date: {{currentUTCTime}}' \
--header 'X-Tg-Date: {{currentUTCTime}}' \
--header 'X-Tg-Content-Sha256;' \
--header 'X-Tg-Content-Sha256;' \
--header 'Accept-Language: {{language}}' \
--header 'Accept-Language: {{language}}' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"name": "开灯",
"description": "打开设备指示灯",
"action": "turn_on_light",
"input_params": [
{
"name": "brightness",
"type": "integer",
"description": "亮度 0-100",
"required": false,
"default_value": "80"
}
],
"return_params": [
{
"name": "success",
"type": "boolean",
"description": "是否执行成功",
"required": true
}
]
}'{
"code": 200,
"msg": "string",
"data": {
"id": "string"
}
}