openMeshLocalGroup(params: Object)

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

const { openMeshLocalGroup } = device;

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

Description

Navigate to the local Mesh group

Parameters

PropertyTypeRequiredDefaultDescription
deviceIdstringYes-Overview Two versions are supported: 1. Local version: only supports filtering by vendorIds. This is local logic: the app filters the device list locally by meshCategory. Group results are stored on the device; the cloud does not participate in retrieving or storing the group list. 2. Cloud version: supports filtering by pccs or codes. This is cloud-side logic: device list retrieval and group–device relationships are stored in the cloud. Local version parameters: { "localId": "203a", "vendorIds": "1F10,2F10" } Cloud version parameters: 1. pcc filtering, equivalent to vendorIds in the old version { "localId": "203a", "type": "0", "pccs": ["1210"], "categoryCode": "7001" } 2. code filtering, filters by the secondary category. Currently the cloud only supports the two remotes ykq and gykzq { "localId": "203a", "type": "1", "codes": ["xxxx"], "categoryCode": "7001" } About categoryCode: categoryCode is not a third-level category, and its matching range with localId is 7001–7008; localId is assigned by the cloud with a step of 8, so a single remote can be associated with up to 8 groups. Starting from the initial value, localId increases by 1, and the corresponding categoryCode increases from 7001 by 1. vendorIds is required and can be an empty string
localIdstringYes-localId Local group identifier
vendorIdsstringYes-Remote controller group, local version: use this parameter; for the cloud version, pass an empty string. vendorIds filters the device list by meshCategory Example: vendorIds: "1F10,2F10"
typestringNo-Remote controller group, cloud version: use this parameter. type Filter condition: 0 = pccs filter, 1 = codes filter
pccsstring[]No-Remote controller group, cloud version: use this parameter. pccs filters the device list by meshCategory Example: pccs: ["1F10","2F10"]
codesstring[]No-For the cloud version of remote control groups, use this parameter Use codes to filter the device list by secondary category Example: codes: ["ykq","gykzq"]
categoryCodestringNo-categoryCode is not a third-level category and matches localId in the range 7001–7008; localId is assigned by the cloud with a step of 8. Therefore, a single remote can associate with up to 8 groups. Starting from the initial value, localId increases by 1, and the matching categoryCode increases from 7001 by 1.
isSupportLowPowerbooleanNofalseWhether low-power mode is supported; required by some wireless switches. Default: false
complete() => voidNo-Completion callback (executed on both success and failure)
success() => voidNo-Callback on successful API call
fail(params: Object) => voidNo-Failure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

device.openMeshLocalGroup({
  deviceId: "xx",
  localId: "xx",
  vendorIds: "1F10,2F10",
  type: "xx",
  pccs: ["1F10", "2F10"],
  codes: ["ykq", "gykzq"],
  categoryCode: "xx",
  isSupportLowPower: false,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});