Schedule API

Schedule

A schedule is used for access control and other configurations such as authentication mode. You can configure a DailySchedule or a WeeklySchedule.

message ScheduleInfo {
  uint32 ID;
  string name;
  DailySchedule daily;
  WeeklySchedule weekly;
  repeated HolidaySchedule holidays;
}

A schedule is either DailySchedule or WeeklySchedule. So, you should not configure both of them in a schedule.

ID
The ID of the schedule.

0 is not a valid ID. And, 1 is reserved for the predefined schedule of ‘Always’. For example, if you set the DoorSchedule.scheduleID to 1, it means that you can access the door all the time.

name
Maximum 48 characters in UTF-8 encoding.
daily
weekly
holidays
Maximum 4 HolidaySchedule can be assigned to a schedule.
message DailySchedule {
  uint32 startDate; 
  repeated DaySchedule daySchedules;
}
startDate
The start date of the schedule in the range of 0 to 365. January 1st is 0.
daySchedules
Up to 90 DaySchedules can be assigned to a DailySchedule.
message WeeklySchedule {
  repeated DaySchedule daySchedules;
}
daySchedules
You have to configure 7 DaySchedules for a WeeklySchedule. The orders are Sunday, Monday, …, and Saturday.
message HolidaySchedule {
  uint32 groupID;
  DaySchedule daySchedule;
}
groupID
The ID of a HolidayGroup.
daySchedule
The DaySchedule, which will be applied for the holidays in the holiday group.
message DaySchedule {
  repeated TimePeriod periods;
}
periods
Maximum 5 TimePeriods can be set per DaySchedule. These periods should not overlap.
message TimePeriod {
  int32 startTime;
  int32 endTime;
}
startTime/endTime
Indicate the time in a day in minutes. For example, 90 means 1:30 AM, and 750 means 12:30 PM.

GetList

Get the schedules stored on a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device
Response
Parameter Type Description
schedules ScheduleInfo[] The schedules stored on the device

Add

Add schedules to a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device
schedules ScheduleInfo[] The schedules to be added to the device

AddMulti

Add schedules to multiple devices.

Request
Parameter Type Description
deviceIDs uint32[] The IDs of the devices
schedules ScheduleInfo[] The schedules to be added to the devices

Delete

Delete schedules from a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device
scheduleIDs uint32[] The IDs of the schedules to be deleted from the device

DeleteMulti

Delete schedules from multiple devices.

Request
Parameter Type Description
deviceIDs uint32[] The IDs of the devices
scheduleIDs uint32[] The IDs of the schedules to be deleted from the devices

DeleteAll

Delete all schedules from a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device

DeleteAllMulti

Delete all schedules from multiple devices.

Request
Parameter Type Description
deviceIDs uint32[] The IDs of the devices

Holiday

You can configure HolidayGroup, which will be used to identify holidays in a schedule.

message HolidayGroup {
  uint32 ID;
  string name;
  repeated Holiday holidays;
}
ID
The ID of the holiday group.
name
Maximum 48 characters in UTF-8 encoding.
holidays
Maximum 128 Holidays can be assigned to a holiday group.
message Holiday {
  uint32 date;
  HolidayRecurrence recurrence;
}
date
The date in the year, in the range 0 to 365. January 1st is 0.
recurrence
Indicate whether this holiday is recurrent one.
enum HolidayRecurrence {
  DO_NOT_RECUR = 0;
  RECUR_YEARLY = 1;
  RECUR_MONTHLY = 2;
  RECUR_WEEKLY = 3;
}

GetHolidayList

Get the holiday groups stored on a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device
Response
Parameter Type Description
groups HolidayGroup[] The holiday groups stored on the device

AddHoliday

Add holiday groups to a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device
groups HolidayGroup[] The holiday groups to be added to the device

AddHolidayMulti

Add holiday groups to multiple devices.

Request
Parameter Type Description
deviceIDs uint32[] The IDs of the devices
groups HolidayGroup[] The holiday groups to be added to the devices

DeleteHoliday

Delete holiday groups from a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device
groupIDs uint32[] The IDs of the holiday groups to be deleted from the device

DeleteHolidayMulti

Delete holiday groups from multiple devices.

Request
Parameter Type Description
deviceIDs uint32[] The IDs of the devices
groupIDs uint32[] The IDs of the holiday groups to be deleted from the devices

DeleteAllHoliday

Delete all holiday groups from a device.

Request
Parameter Type Description
deviceID uint32 The ID of the device

DeleteAllHolidayMulti

Delete all holiday groups from multiple devices.

Request
Parameter Type Description
deviceIDs uint32[] The IDs of the devices