getCurrentHomeInfo(params: Object)

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);
}

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 Since
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
rolenumberHome role, values from ThingSmartHomeRolev3.7.12
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);
  },
});