智慧型住宅應用程式選取器特徵結構定義

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

語音指令範例

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 TV:n

裝置錯誤

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