歡迎使用 Google Home 開發人員中心,探索全新功能,瞭解如何開發智慧住宅動作。注意:請繼續在「動作」控制台中建立動作。
透過集合功能整理內容 你可以依據偏好儲存及分類內容。

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

action.devices.traits.AppSelector - 此屬性可用於可切換輸入裝置的裝置。

裝置屬性

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

屬性 類型 說明
availableApplications 陣列

必填。

應用程式清單。每個應用程式都有一種以上的同義詞。回應會使用第一個同義詞。

[item, ...] 物件

這部裝置使用者可以進行互動的應用程式。

key 字串

必填。

不會透過語音或回應向使用者呈現的應用程式專屬金鑰。

names 陣列

必填。

每個應用程式的名稱及其特定語言同義詞的名稱。

[item, ...] 物件

應用程式同義詞。

name_synonym 陣列

必填。

特定語言的應用程式名稱的容易同義詞。回應會使用第一個同義詞。

[item, ...] 字串

應用程式名稱。

lang 字串

必填。

語言代碼。

範例

使用 YouTube 應用程式的裝置

{
  "availableApplications": [
    {
      "key": "youtube",
      "names": [
        {
          "name_synonym": [
            "YouTube",
            "YouTube US"
          ],
          "lang": "en"
        },
        {
          "name_synonym": [
            "YouTube",
            "YouTube DE"
          ],
          "lang": "de"
        }
      ]
    }
  ]
}

裝置狀態:STATE

具有此特性的實體可能會在 QUERY 作業中回報下列狀態。如要進一步瞭解如何處理 QUERY 意圖,請參閱意圖執行要求一文。

類型 說明
currentApplication 字串

必填。

前景中目前使用中的應用程式金鑰值。

範例

具備 YouTube 應用程式的裝置目前於前景運作。

{
  "currentApplication": "YouTube"
}

裝置指令

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

action.devices.commands.appInstall

安裝指定的應用程式。

參數

參數 類型 說明
newApplication 字串

要安裝的應用程式金鑰。

newApplicationName 字串

要安裝的應用程式名稱。

範例

依金鑰安裝 YouTube 應用程式

{
  "command": "action.devices.commands.appInstall",
  "params": {
    "newApplication": "YouTube"
  }
}

依名稱安裝 YouTube 應用程式

{
  "command": "action.devices.commands.appInstall",
  "params": {
    "newApplicationName": "YouTube US"
  }
}

action.devices.commands.appSearch

搜尋指定的應用程式。

參數

參數 類型 說明
newApplication 字串

要搜尋的應用程式金鑰。

newApplicationName 字串

要搜尋的應用程式名稱。

範例

按金鑰搜尋 YouTube 應用程式

{
  "command": "action.devices.commands.appSearch",
  "params": {
    "newApplication": "YouTube"
  }
}

依名稱搜尋 YouTube 應用程式

{
  "command": "action.devices.commands.appSearch",
  "params": {
    "newApplicationName": "YouTube US"
  }
}

action.devices.commands.appSelect

選取指定的應用程式。

參數

參數 類型 說明
newApplication 字串

要選取的應用程式金鑰。

newApplicationName 字串

要選取的應用程式名稱。

範例

依金鑰選取 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

裝置錯誤:ERRORS

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