openGroupTimerPage

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

const { openGroupTimerPage } = device;

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

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

Description

Navigate to the group timer page

Parameters

PropertyTypeRequiredDescriptionMinimum SDK versions
groupIdstringYesgroupId Group ID—
categorystringYescategory Timer category—
repeatnumberNoNote: This field is deprecated—
dataRecord<string, any>[]Yesdata DP data { "dpName": DP name, string "dpId": DP ID, string "selected": index of the DP default value, t.Integer "rangeKeys": value range of the DP, Array<object> "rangeValues": display range of the DP, Array<string> }—
NotimerConfig UI configuration—
complete() => voidNoCompletion callback (executed on both success and failure)—
success() => voidNoCallback on successful API call—
fail(params: Object) => voidNoFailure callback—
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

device.openGroupTimerPage({
  groupId: "212590147",
  category: "1",
  data: [{
    dpId: 1,
    dpName: "Switch",
    rangeKeys: [1, 0],
    rangeValues: ["On", "Off"],
    selected: 0
  }],
  timerConfig: { background: "FFFFFF" },  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});