智慧型住宅 AppSelector 特徵結構定義

action.devices.traits.AppSelector:此特徵用於可切換應用程式的裝置。

裝置屬性

具備此特徵的裝置可能會在 SYNC 作業中回報下列屬性。如要進一步瞭解如何處理 SYNC 意圖,請參閱「意圖執行要求」。

屬性 類型 說明
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 意圖,請參閱「意圖執行要求」。

類型 說明
currentApplication String

必填。

目前在前景執行的應用程式鍵值。

範例

裝置目前在前景處於 YouTube 應用程式活動狀態。

{
 
"currentApplication": "YouTube"
}

裝置指令

具備此特徵的裝置可能會在 EXECUTE 作業中回應下列指令。如要進一步瞭解如何處理 EXECUTE 意圖,請參閱「意圖執行要求」。

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"
 
}
}

範例對話

  • Öffne Netflix auf dem Fernseher .
  • begin using YouTube app on the smart TV
  • pon netflix en la tele del salón
  • Mets Netflix sur la télé .
  • टीवी पर नेटफ्लिक्स ऍप लॉन्च करो
  • Apri Netflix sulla televisione della mia camera .
  • YouTube のアプリを テレビ でスタート
  • TV 에서 유튜브 앱 열어 줘
  • Start Netflix op mijn TV .
  • Abra o Netflix na TV para mim.
  • Abre o Youtube na televisão .
  • Öppna Youtube TV:n

裝置錯誤

請參閱錯誤和例外狀況的完整清單。
  • noAvailableApp:應用程式不存在或無法使用。
  • appLaunchFailed:應用程式啟動失敗。
  • alreadyInstalledApp:應用程式已安裝。