getCurrentHomeInfo

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

const { getCurrentHomeInfo } = home;

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

Method signature
getCurrentHomeInfo(params: )
Minimum SDK versions
iOSThingSmartHomeKitBizBundle
≥ 5.2.0
Androidcom.thingclips.smart:thingsmart-bizbundle-homekit
≥ 5.2.0

Description

Get current home information

Parameters

PropertyTypeRequiredDescription
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
PropertyTypeDescriptionHomeKit SinceMinimum SDK versions
homeNamestringHome namev3.0.3—
homeIdstringHome IDv3.0.3—
longitudestringLongitudev3.0.3—
latitudestringLatitudev3.0.3—
addressstringDetailed addressv3.0.3—
adminbooleanIs admin true: admin; false: not adminv3.0.3—
modenumberHome mode, values from ThingSmartHomeModev3.7.8
iOSThingSmartHomeKitBizBundle
≥ 6.7.0
Androidcom.thingclips.smart:thingsmart-bizbundle-homekit
≥ 6.7.0
rolenumberHome role, values from ThingSmartHomeRolev3.7.12
iOSThingSmartHomeKitBizBundle
≥ 6.7.0
Androidcom.thingclips.smart:thingsmart-bizbundle-homekit
≥ 6.7.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

home.getCurrentHomeInfo({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});