请扫码查看示例
# addInstructToSiriShortcut ^8.7
添加 Siri 自定义指令 Shortcut
# 请求参数
Prop | Type | Default | Comment |
---|---|---|---|
sceneName | String | N/A | 执行的场景名称,同一个 sceneId 下不能同名 |
sceneId | String | N/A | 执行的场景 ID,可以用 deviceId |
jsonData | String | N/A | 执行场景需要的参数 json 字符串 |
url | String | N/A | 执行场景的 url,如执行场景的 url 为/v2/scene/execute,(scheme 为https://mp-prod.smartmidea.net:443/mas/v5/app/proxy?alias=),执行的url返回成功的code必须为0 |
httpMethod: | String | N/A | "get/post",不区分大小写 |
# 引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
1
# 接口调用示例
const params = {
sceneName: '空调控制123', //string:执行的场景名称,同一个sceneId下不能同名
sceneId: '11934323', //string:执行的场景ID,可以用deviceId
jsonData: "{'control':'on','temp':'24.5'}",
url: '/v2/scene/execut',
httpMethod: 'get', //string:不区分大小写,
}
bridge
.addInstructToSiriShortcut(params)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- 成功时返回 Object(res)
Prop | Type | Default | Comment |
---|---|---|---|
status | string | N/A | "0"用户取消添加 “1” 添加成功 |
- 失败时返回
Prop | Type | Default | Comment |
---|---|---|---|
error | string | N/A | 参数不全 |
# 接口返回示例
{
"status": "0" // // "0"用户取消添加 “1” 添加成功
}
{
"error":"参数不全"
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9