Cloud Timer

Last Updated on : 2024-06-05 03:14:31download

The Cloud Timer component allows you to view the list of scheduled tasks, edit each scheduled task, and set the repeat mode. On the scheduled task edit page, you can add, modify, or delete a task, and enable data point (DP) linkage. For more information, see Cloud Timer.

Preview

Cloud Timer

API description

uiIdParams: Object

Parameter Type Description Required
uiId string The ID of the UI to be navigated to. Yes

pageParams: Object

Parameter Type Description Default value Required
is12Hours boolean Specifies whether to use the 12-hour clock format. false No
isRepeatRoute boolean Specifies whether to display repeated pages in the route format. true No
theme { type: 'light'|'dark' } The theme configuration. { type: ‘light’ } No
timerConfig ITimerConfig The timer configuration. \ Yes

timerConfig: ITimerConfig

Parameter Type Description Default value Required
loop boolean Specifies whether the time selector supports the repeat mode. true No
category string The type of category. \ Yes
limit number The upper limit of the number of scheduled tasks. 30 No
data IConfigData[] The DPs that are linked to scheduled tasks. \ Yes

data: IConfigData

Parameter Type Description Default value Required
dpId number The ID of a DP. \ Yes
dpName string The name of a DP. \ Yes
selected number The index value of the default selected value. \ Yes
rangeKeys (boolean|string)[] A collection of DP values. \ Yes
rangeValues { dpValue: string, subItem? : string }[] A collection of names of DP values. subItem specifies a DP to be linked. \ Yes
isSubItem boolean Specifies whether a DP is linked. \ No

Example

// When DP 101 is set to `Off`, DP 102 disappears.
TYSdk.mobile.jumpSubPage(
  { uiId: '0000016i81' },
  {
        timerConfig: {
           category: 'TYCloudTimer',
           loop: true,
           repeat: 0,
           data: [
               {
                  dpId: 101,
                   dpName: 'Switch 1',
                   selected: 0,
                   rangeKeys: [true, false],
                   rangeValues: [{ dpValue: 'On', subItem: '102' }, { dpValue: 'Off' }],
               },
                {
                   dpId: 102,
                   dpName: 'Light mode',
                   selected: 0,
                   rangeKeys: ['colour', 'white', 'gradient'],
                   rangeValues: [
                        { dpValue: 'Colored light' },
                        { dpValue: 'White light' },
                        { dpValue: 'Gradient' },
                     ],
                     isSubItem: true,
                    },
                  ],
                },
              }
);

Multilingual fields

    TYCloudTimer_noTimer: 'No scheduled task',
    TYCloudTimer_add: 'Add',
    TYCloudTimer_timerList: 'Scheduled task',
    TYCloudTimer_remind: 'There may be an error of about 30 seconds in the timer',
    TYCloudTimer_confirmDeleteTime: 'Are you sure to delete this scheduled task?' ,
    TYCloudTimer_confirm: 'Confirm',
    TYCloudTimer_cancel: 'Cancel',
    TYCloudTimer_deleteSuccess: 'Deleted successfully',
    TYCloudTimer_addTimer: 'Add scheduled task',
    TYCloudTimer_save: 'Save',
    TYCloudTimer_AM: 'AM',
    TYCloudTimer_PM: 'PM',
    TYCloudTimer_day0: 'Sun',
    TYCloudTimer_day1: 'Mon',
    TYCloudTimer_day2: 'Tue',
    TYCloudTimer_day3: 'Wed',
    TYCloudTimer_day4: 'Thu',
    TYCloudTimer_day5: 'Fri',
    TYCloudTimer_day6: 'Sat',
    TYCloudTimer_repeat: 'Repeat',
    TYCloudTimer_everyDay0: 'Every Sunday',
    TYCloudTimer_everyDay1: 'Every Monday',
    TYCloudTimer_everyDay2: 'Every Tuesday',
    TYCloudTimer_everyDay3: 'Every Wednesday',
    TYCloudTimer_everyDay4: 'Every Thursday',
    TYCloudTimer_everyDay5: 'Every Friday',
    TYCloudTimer_everyDay6: 'Every Saturday',
    TYCloudTimer_dayOnce: 'Once',
    TYCloudTimer_dayEvery: 'Every Day',
    TYCloudTimer_tag: 'Tag',
    TYCloudTimer_notice: 'Alert',
    TYCloudTimer_custom: 'Custom',
    TYCloudTimer_delete: 'Delete',
    TYCloudTimer_editTimer: 'Edit Schedule',
    TYCloudTimer_alreadyKnown: 'Already Known',
    TYCloudTimer_timeLimit: 'No more scheduled tasks can be created',
    TYCloudTimer_addSuccess: 'Added successfully',
    TYCloudTimer_weekDays: 'Weekdays',
    TYCloudTimer_weekend: 'Weekend',