openGroupTimerPage(params: Object)

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

Description

Navigate to the group timer page

Parameters

PropertyTypeRequiredDescription
groupIdstringYesgroupId Group ID
categorystringYescategory Timer category
repeatnumberNoNote: This field is deprecated
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);
  },
});