更新时间:2023-07-06 08:27:39下载pdf
本文介绍更新一键执行的 API。
根据一键执行 ID 更新一键执行。动作个数上限为 50 个。
PUT: /v2.0/iot-03/scenes/{scene_id}
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 | 
|---|---|---|---|---|
| scene_id | String | uri | true | 一键执行 ID | 
body 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 | 
|---|---|---|---|---|
| name | String | true | 一键执行名称 | |
| dsl | SceneDsl | true | 一键执行规则语言 | 
dsl 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 | 
|---|---|---|---|---|
| actions | List | true | 一键执行动作列表 | 
actions 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 | 
|---|---|---|---|---|
| execution_type | String | true | 执行类型:
  | |
| execution_rule | Object | true | 执行规则。见execution_rule详细说明。 | 
| 参数名 | 类型 | 说明 | 
|---|---|---|
| result | Boolean | 更新结果。
  | 
PUT: /v2.0/iot-03/scenes/wukW5YYf561r****
{
  "name": "这是一个一键执行",
  "dsl": {
    "actions": [
      {
        "execution_type": "delay",
        "execution_rule": {
          "delay_seconds": 60
        }
      },
      {
        "execution_type": "deviceIssue",
        "execution_rule": {
          "execution_id": "vdevo16292691746****",
          "function_code": "bright_value",
          "function_value": 20
        }
      },
      {
        "execution_type": "deviceGroupIssue",
        "execution_rule": {
          "execution_id": "144790134147200****",
          "function_code": "switch_1",
          "function_value": true
        }
      }
    ]
  }
}
{
    "result": true,
    "t": 1635844703309,
    "success": true
}
参考 错误码。
当 execution_type 为 delay 时:
| 参数名 | 类型 | 说明 | 必填 | 
|---|---|---|---|
| delay_seconds | Long | 延时时间,取值范围 1~5 * 60 * 60,单位:秒 | 是 | 
当 execution_type 为 deviceIssue 或 deviceGroupIssue 时:
| 参数名 | 类型 | 说明 | 必填 | 
|---|---|---|---|
| execution_id | String | 设备或设备群组 ID | 是 | 
| function_code | String | 设备或设备群组指令码 | 是 | 
| function_value | Object | 设备或设备群组指令值 | 是 | 
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈