getDeviceIdList(params: Object)

Requires:
HomeKit≥3.1.0@ray-js/ray≥1.2.10
Platforms:
iOSAndroid
import { home } from '@ray-js/ray';

const { getDeviceIdList } = home;

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

Description

Get the list of device IDs under the current home from local cache

Parameters

PropertyTypeRequiredDescriptionHomeKit Since
ownerIdnumberYesHome ID-
roomIdnumberYesRoom IDv3.7.10
devIdstringYesDevice IDv3.8.0
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
PropertyTypeDescription
devIdsstring[]Device ID list
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

home.getDeviceIdList({
  ownerId: 8069808,
  roomId: 57426831,
  devId: "6c2a2eiadnrgt0wd",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});