智能家居 AppSelector 特征架构
action.devices.traits.AppSelector - 此特征用于能够在应用之间切换的设备。
设备属性
具有此特征的设备可能会在 SYNC 操作中报告以下属性。如需详细了解如何处理 SYNC intent,请参阅 Intent 实现。
| 属性 | 类型 | 说明 |
|---|---|---|
availableApplications |
数组 |
必填。 应用列表。每款应用在每种支持的语言中都有一个或多个同义词。系统会在回答中使用第一个同义词。 |
[item, ...] |
对象 |
此设备的用户可以与之互动的应用。 |
key |
String |
必填。 应用的唯一键,不会在语音或响应中向用户公开。 |
names |
数组 |
必填。 每个应用的名称及其特定于语言的同义词。 |
[item, ...] |
对象 |
应用同义词。 |
name_synonym |
数组 |
必填。 相应语言的应用名称的易记同义词。系统会在回答中使用第一个同义词。 |
[item, ...] |
String |
应用名称。 |
lang |
String |
必填。 语言代码。 |
示例
搭载 YouTube 应用的设备
{
"availableApplications": [
{
"key": "youtube",
"names": [
{
"name_synonym": [
"YouTube",
"YouTube US"
],
"lang": "en"
},
{
"name_synonym": [
"YouTube",
"YouTube DE"
],
"lang": "de"
}
]
}
]
}设备状态
具有此特征的实体可能会报告以下状态作为 QUERY 操作的一部分。如需详细了解如何处理 QUERY intent,请参阅intent 执行。
| 州 | 类型 | 说明 |
|---|---|---|
currentApplication |
String |
必填。 当前在前台处于活跃状态的应用的键值。 |
示例
YouTube 应用当前在前台处于活跃状态的设备。
{
"currentApplication": "YouTube"
}设备命令
具有此特征的设备可能会响应以下命令,作为 EXECUTE 操作的一部分。如需详细了解如何处理 EXECUTE intent,请参阅 Intent 实现。
action.devices.commands.appInstall
安装指定应用。
参数
| 参数 | 类型 | 说明 |
|---|---|---|
newApplication |
String |
要安装的应用的键。 |
newApplicationName |
String |
要安装的应用的名称。 |
示例
按键安装 YouTube 应用
{
"command": "action.devices.commands.appInstall",
"params": {
"newApplication": "YouTube"
}
}按名称安装 YouTube 应用
{
"command": "action.devices.commands.appInstall",
"params": {
"newApplicationName": "YouTube US"
}
}action.devices.commands.appSearch
搜索给定的应用。
参数
| 参数 | 类型 | 说明 |
|---|---|---|
newApplication |
String |
要搜索的应用的键。 |
newApplicationName |
String |
要搜索的应用的名称。 |
示例
按键搜索 YouTube 应用
{
"command": "action.devices.commands.appSearch",
"params": {
"newApplication": "YouTube"
}
}按名称搜索 YouTube 应用
{
"command": "action.devices.commands.appSearch",
"params": {
"newApplicationName": "YouTube US"
}
}action.devices.commands.appSelect
选择给定的应用。
参数
| 参数 | 类型 | 说明 |
|---|---|---|
newApplication |
String |
要选择的应用的键。 |
newApplicationName |
String |
要选择的应用的名称。 |
示例
通过按键选择 YouTube 应用
{
"command": "action.devices.commands.appSelect",
"params": {
"newApplication": "YouTube"
}
}按名称选择 YouTube 应用
{
"command": "action.devices.commands.appSelect",
"params": {
"newApplicationName": "YouTube US"
}
}示例话语
de-DE
- Öffne Netflix auf dem Fernseher .
en-US
- begin using YouTube app on the smart TV
es-ES
- pon netflix en la tele del salón
fr-FR
- Mets Netflix sur la télé .
hi-IN
- टीवी पर नेटफ्लिक्स ऍप लॉन्च करो
it-IT
- Apri Netflix sulla televisione della mia camera .
ja-JP
- YouTube のアプリを テレビ でスタート
ko-KR
- TV 에서 유튜브 앱 열어 줘
nl-NL
- Start Netflix op mijn TV .
pt-BR
- Abra o Netflix na TV para mim.
- Abre o Youtube na televisão .
sv-SE
- Öppna Youtube på TV:n
设备错误
查看错误和异常的完整列表。noAvailableApp:应用不存在或不可用。appLaunchFailed:应用启动失败。alreadyInstalledApp:应用已安装。