getGroupDpsInfos
获取群组设备所有 DP 信息。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
groupId | String | 群组 ID | 是 |
返回参数
参数 | 数据类型 | 说明 |
---|---|---|
code | String | DP Code |
dpId | Number | DP ID |
value | String | DP 值 |
name | String | DP 名称 |
time | Number | DP 最近上报时间 |
type | String | DP 类型 |
请求示例
import { getGroupDpsInfos } from '@ray-js/ray';
getGroupDpsInfos('1')
.then((response) => {
console.log(response);
})
.catch();
返回示例
{
{
"code": "switch_spray",
"dpId": 1,
"value": "true",
"name": "",
"time": 1572338762533,
"type": "bool"
},
{
"code": "mode",
"dpId": 2,
"value": "large",
"name": "",
"time": 1572333409976,
"type": "enum"
},
}
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
getGroupDeviceList
获取群组下设备列表
引入
import { getGroupDeviceList } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.4.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | 群组 id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
groupId | string | groupId 群组 id |
deviceList | array | deviceList 设备列表 |
object.fail 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
errorMsg | string | 插件错误信息 |
errorCode | string | 错误码 |
innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
getGroupDeviceNum
获取群组下设备数量
引入
import { getGroupDeviceNum } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.4.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | 群组 id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
groupId | string | groupId 群组 id |
devieNum | number | devieNum 设备数量 |
object.fail 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
errorMsg | string | 插件错误信息 |
errorCode | string | 错误码 |
innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
getGroupInfo
获取 group 信息
引入
import { getGroupInfo } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.3.1
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | 群组 id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
groupId | string | groupId The group ID. |
productId | string | productId The product ID. |
name | string | name The name of the group. |
time | number | time The time when the group was created. |
iconUrl | string | iconUrl The URL of the icon. |
type | number | type The type of group. Wifi = 0, Mesh = 1, Zigbee = 2, SIGMesh = 3, Beacon = 4, |
isShare | boolean | isShare |
dps | object | dps |
dpCodes | object | dpCodes |
deviceNum | number | deviceNum The number of devices, |
localKey | string | localKey The local key. |
pv | number | The protocol version. |
productInfo | object | The product information. |
dpName | object | The custom DP name. |
deviceList | array | The device list. |
localId | string | The local short address of groups. |
pcc | string | The subclass. |
meshId | string | The mesh ID or gateway ID. |
groupKey | string | Add the beacon beaconKey. |
schema | array | The schema array. |
object.fail 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
errorMsg | string | 插件错误信息 |
errorCode | string | 错误码 |
innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
onGroupInfoChange
群组内增加/移除设备事件
引入
import { onGroupInfoChange } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.4.0
版本才可使用
参数
function callback
群组内增加/移除设备事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | groupId 群组 id |
offGroupInfoChange
取消监听:群组内增加/移除设备事件
引入
import { offGroupInfoChange } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.4.0
版本才可使用
参数
function callback
取消监听:群组内增加/移除设备事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | groupId 群组 id |
onGroupRemovedEvent
群组移除事件
引入
import { onGroupRemovedEvent } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.3.1
版本才可使用
参数
function callback
群组移除事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | 群组 id |
offGroupRemovedEvent
取消监听:群组移除事件
引入
import { offGroupRemovedEvent } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.3.1
版本才可使用
参数
function callback
取消监听:群组移除事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
groupId | string | 是 | 群组 id |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。