通过 Trait 控制设备
POST/devices/trait/execute
通过 Trait 控制设备,包括如下操作:
- 更新属性(如开关、温度等,functionCode 与 traitCode 请调用 /devices/definitions 接口查询)
- 更换设备所在房间(functionCode="EndpointLabel", traitCode="EndpointRoom")
- 改名(functionCode="EndpointLabel", traitCode="EndpointName")
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 429
- 500
请求发起成功,但不代表所有 trait value 设置成功。
code 为 0 表示至少部分成功;code 不为 0 表示全部失败。
若 data 存在,表示为设置失败的 trait 集合,若无则全部成功。
请求参数错误
未认证或认证失效
无权限访问
资源不存在
请求频率过高
服务内部错误