小米电视机API开发接口

获取电视机基础信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
http://192.168.8.31:6095/request?action=isalive


{
"status": 0,
"msg": "success",
"data": {
"devicename": "E",
"ip": "192.168.8.31:6095",
"feature": [
"power"
],
"url": [
"http://bilibili.kankanews.com/video/av\\d+/",
"http://www.bilibili.tv/video/av\\d+/"
],
"platform": 699,
"build": 3354,
"version": 16777510
}
}

获取电视机安装的APP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
http://192.168.8.31:6095/controller?action=getinstalledapp&count=999&changeIcon=1


{
"status": 0,
"msg": "success",
"data": {
"AppInfo": [
{
"PackageName": "com.mitv.alarmcenter",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.mitv.alarmcenter0.png",
"AppName": "定时提醒",
"Order": 1
},
{
"PackageName": "com.dangbei.lerad.videoposter",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.dangbei.lerad.videoposter0.png",
"AppName": "当贝播放器",
"Order": 2
},
{
"PackageName": "com.qisyun.sunday.cxyp",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.qisyun.sunday.cxyp0.png",
"AppName": "创享云屏",
"Order": 3
},
{
"PackageName": "com.baidu.netdisk.tv",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.baidu.netdisk.tv0.png",
"AppName": "百度网盘",
"Order": 4
},
{
"PackageName": "com.xiaomi.tweather",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.tweather0.png",
"AppName": "天气",
"Order": 5
},
{
"PackageName": "com.duokan.videodaily",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.duokan.videodaily0.png",
"AppName": "视频头条",
"Order": 6
},
{
"PackageName": "com.xiaomi.mitv.handbook",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.handbook0.png",
"AppName": "玩机手册",
"Order": 7
},
{
"PackageName": "com.mitv.tvhome",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.mitv.tvhome0.png",
"AppName": "桌面",
"Order": 8
},
{
"PackageName": "com.xiaomi.mitv.tvmanager",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.tvmanager0.png",
"AppName": "电视管家",
"Order": 9
},
{
"PackageName": "com.xiaomi.mitv.calendar",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.calendar0.png",
"AppName": "日历",
"Order": 10
},
{
"PackageName": "com.xiaomi.voicecontrol",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.voicecontrol0.png",
"AppName": "小爱同学",
"Order": 11
},
{
"PackageName": "com.mitv.gallery",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.mitv.gallery0.png",
"AppName": "相册",
"Order": 12
},
{
"PackageName": "com.xiaomi.mitv.settings",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.settings0.png",
"AppName": "电视设置",
"Order": 13
},
{
"PackageName": "com.xiaomi.tv.gallery",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.tv.gallery0.png",
"AppName": "时尚画报",
"Order": 14
},
{
"PackageName": "com.xiaomi.mitv.smartshare",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.smartshare0.png",
"AppName": "无线投屏",
"Order": 15
}
]
}
}

浏览器远程启动电视APP

1
2
3
4
5
6
7
http://192.168.8.31:6095/controller?action=startapp&type=packagename&packagename=com.xiaomi.tweather

{
"status": 0,
"msg": "success",
"data": null
}

通过浏览器实现按键输入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
http://192.168.8.31:6095/controller?action=keyevent&keycode=enter

{
"status": 0,
"msg": "success",
"data": {}
}


keycode 功能
power 设备开关
up 控制光标上
down 控制光标下
left 控制光标左
right 控制光标右
enter 确认键
home 返回桌面
back 回退键
menu 打开菜单
volumeup 增加音量
volumedown 减小音量