更新时间:2023-12-07 03:33:56下载pdf
本文介绍修改场景的 API。
修改某个家庭下的场景。
PUT: /v1.0/homes/{home_id}/scenes/{scene_id}
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
|---|---|---|---|---|
| home_id | String | uri | true | 家庭 ID。 |
| scene_id | String | uri | true | 场景 ID。 |
body 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
|---|---|---|---|---|
| background | String | body | true | 背景图片。 |
| actions | List | body | true | 动作列表。 |
| name | String | body | true | 场景名称。 |
actions 说明
| 参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
|---|---|---|---|---|
| entity_id | String | body | false | 设备 ID,设备相关必填。 |
| executor_property | Object | body | true | 执⾏动作参数。 |
| action_executor | String | body | true | 执⾏动作类别,例如 dpIssue 和 delay。 |
| 参数名 | 类型 | 说明 |
|---|---|---|
| result | Boolean | 返回结果。修改成功返回 true。 |
PUT: /v1.0/homes/242****/scenes/53IYSXI3gEn2****
{
"name": "添加场景测试",
"background": "https://images.tuyacn.com/smart/rule/cover/****.png",
"actions": [
{
"executor_property": {
"hours": "0",
"minutes": "0",
"seconds": "5"
},
"action_executor": "delay"
},
{
"executor_property": {
"work_mode": "scene_2"
},
"action_executor": "dpIssue",
"entity_id": "0120090568c63a89****"
}
]
}
{
"tid": "2c1fc5cf7f4511ee82774ab24801****",
"result": true,
"t": 1540799929837,
"success": true
}
参考 错误码。
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈