getDeviceNumWithDpCode

Requires:
DeviceKit≥2.4.0@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
import { device } from '@ray-js/ray';

const { getDeviceNumWithDpCode } = device;

// Promise usage
try {
  const res = await getDeviceNumWithDpCode({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Method signature
getDeviceNumWithDpCode(params: )
Minimum SDK versions
iOSThingSmartDeviceKitBizBundle
≥ 5.2.0
Androidcom.thingclips.smart:thingsmart-bizbundle-devicekit
≥ 5.2.0

Description

Get the count of devices in the group that have the specified dpCode. If it is a shared group, obtain it via the API.

Parameters

PropertyTypeRequiredDescriptionMinimum SDK versions
groupIdstringYesgroupId Group ID—
dpCodestringYesdpCode value—
complete() => voidNoCompletion callback (executed on both success and failure)—
success(params: Object) => voidNoCallback on successful API call—
fail(params: Object) => voidNoFailure callback—
success callback parameters
PropertyTypeDescriptionDeviceKit SinceMinimum SDK versions
groupIdstringgroupId Group IDv3.3.0—
deviceNumnumberdeviceNum Device countv4.13.1
iOSThingSmartDeviceKitBizBundle
≥ 6.2.0
Androidcom.thingclips.smart:thingsmart-bizbundle-devicekit
≥ 6.2.0
devieNumDeprecatednumberdevieNum Device count
↳ The field name appears to be misspelled; please use deviceNum
v3.3.0—
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { device } from '@ray-js/ray'

device.getDeviceNumWithDpCode({
  groupId: "xx",
  dpCode: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});