请扫码查看示例
# getHomeInfo ^7.9
获取家庭信息及其设备列表
# 请求参数
Prop | Type | Default | Comment |
---|---|---|---|
homeId | String | N/A | 家庭 id |
isCurrentFamily | String | N/A | 是否是当前家庭 ,0:否,1 是 |
hasRoomAndDeviceInfo | String | N/A | 是否附带房间和设备信息,0:否,1 是 |
# 引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
1
# 接口调用示例
const params = {
homeId: '家庭id',
isCurrentFamily: '是否是当前家庭 ,0:否,1是',
hasRoomAndDeviceInfo: '是否附带房间和设备信息,0:否,1是 ',
}
bridge
.getHomeInfo(params)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 接口返回示例
{
"homeId": "123456",
"homeName": "林首富之家",
"isOwner": "1",
"address": "string",
"coordinate": "string",
"areaid": "string",
"isLocal": "0",
"deviceList": [
{
"masterId": "xxx",
"roomId": "xxx",
"roomName": "xxx",
"deviceId": "xxxxx",
"deviceName": "xxxxxx",
"deviceType": "xxxx",
"deviceSubType": "xxxxx",
"deviceSn": "xxxxxxxxx",
"deviceSnDecrypt": "xxxxx",
"deviceSn8": "xxxxxxxx",
"isOnline": 1,
"attrs": "xxx"
}
],
"roomList": [
{
"roomId": "xxx",
"name": "xxx",
"des": "xxx",
"icon": "",
"isDefault": "1"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36