设置局域网排程
# 设置局域网排程
Path:
/api/lanschedule
Method: PUT
接口描述: 排程能实现盒子的自动化控制(比如节目的轮播和播放顺序,指令到点执行) 排程应用场景:
- 白天工作,晚上休眠(省电)
- 节假日自动播放节日节目,平时播放普通节目
- ......
排程分为节目排程和指令排程
节目排程:控制节目的插播,轮播,指定时间播放指定的节目
指令排程:控制指令的执行,特定时间点执行特定的指令
请求参数
节目排程 节目排程可以控制:
节目的播放时间,日期,周。
节目的播放顺序,插播,轮播.
关键字:
(1) 时间:当天的起始时间和结束时间
"if_limit_time": false, // false代表默认整天播放
"limit_time": { // 开始时间和结束时间,开始时间大于结束时间时表示跨天
"end_time": "18:00:00",
"start_time": "06:00:00"
}
(2) 日期:日期的起始和结束
"if_limit_date": false, // false代表默认一直播放
"limit_date": { // 开始日期和结束日期,精确到秒
"end": "2018-12-14",
"end_time": "23:59:59",
"start": "2018-12-14",
"start_time": "00:00:00"
}
(3) 周: 周一到周天
"if_limit_weekday": false, //false默认全周播放
"limit_weekday":[true, true, true, true, true, true, true]
(4) 实际播放时间: 时间,周, 日期的交集
(5) priority :节目优先级顺序0~100...(轮播时按此顺序执行),必须不一样,否则终端无法执行排程
(6) type_priority : 100 //插播, 有效时间内只播放优先级最高的插播节目
200 //轮播 有效时间内按节目顺序轮流播放轮播节目,有插播时只播插播节目
300 //垫播 没有轮播和插播时,播放符合条件且优先级最高的垫播节目
(7) operation: "operation": {
"name": "Playlist2924", //节目名
"source": "internet", //节目类型,服务器节目都是internet,若节目来自局域网发布则为lan,若为U盘发布则为usb。
"vsn": "Playlist2924_334D90B44F26E0D7C8298B7388CD104B_1445.vsn", //节目vsn文件名,可以通过获取播放盒节目列表得到对应的
"id": 23164 //节目Id,可以不填
}指令排程
指令排程除了 1.切换信号源,2 重启 是到点执行的指令
其他指令都是状态指令,指令需要成对出现,否则全天都只有一个状态。
关键字:
(1) 时间 :"op_time":["16:48:21"], //当天执行时间
(2) 日期:日期的起始和结束
"if_limit_date": false, // false代表默认一直执行
"limit_date": { // 开始日期和结束日期
"end": "2018-12-14",
"start": "2018-12-14",
}
(3) 周: 周一到周天
"if_limit_weekday": false, //false默认全周播放
"limit_weekday":[true, true, true, true, true, true, true]
(4) 指令:operation //需要执行的指令
指令类型有7种:
休眠
"operation": {
"author_url": "api/action",
"karma": 1,
"content": "{"command":"sleep"}"
}
唤醒
"operation": {
"author_url": "api/action",
"karma": 1,
"content": "{"command":"wakeup"}"
}
重启
"operation": {
"author_url": "api/action",
"karma": 1,
"content": "{"command":"reboot"}"
}
亮度调节
"operation": {
"author_url": "api/brightness",
"karma": 2,
"content": "{"brightness":"0"}" //范围为 0-100
}
色温调节
"operation": {
"author_url": "api/colortemp",
"karma": 2,
"content": "{"colortemp":2000}" //范围为 2000-10000
}
音量控制
"operation": {
"author_url": "api/volume",
"karma": 2,
"content": "{"musicvolume":0}" //范围为 0-15
}
切换信号源
同步信号:
"operation": {
"author_url": "api/inputmode",
"karma": 2,
"content": "{"inputmode":"hdmi"}"
}
异步信号:
"operation": {
"author_url": "api/inputmode",
"karma": 2,
"content": "{"inputmode":"dvi"}"
}
请求示例
"commandSchedule": [
{
"operation": {
"author_url": "api/brightness",
"karma": 2,
"content": "{\"brightness\":\"0\"}"
},
"op_time": [
"16:52:00"
],
"if_limit_date": false,
"limit_date": {
"start": "2018-12-13",
"end": "2018-12-13"
},
"if_limit_weekday": false,
"limit_weekday": [
true,
true,
true,
true,
true,
true,
true
]
}
],
"contentsSchedule": [
{
"limit_date": {
"end": "2018-12-14",
"end_time": "23:59:59",
"start": "2018-12-14",
"start_time": "00:00:00"
},
"limit_time": {
"end_time": "18:00:00",
"start_time": "06:00:00"
},
"limit_weekday": [
true,
true,
true,
true,
true,
true,
true
],
"operation": {
"name": "Playlist2924",
"source": "internet",
"vsn": "Playlist2924_B9D968E64941B7EE026D65448079583F_1341.vsn",
"id": 22729
},
"if_limit_date": false,
"priority": 0,
"if_limit_time": false,
"if_limit_weekday": false,
"type_priority": 200
}
]
}