對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
註冊特質
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Google 助理必須能夠將查詢與傳送至裝置的指令建立關聯。為使這項作業能順利運作,您必須宣告裝置支援哪些功能。這些功能稱為「特徵」。您可以在裝置型號中宣告這些特徵。
Google 已在許多裝置上建立各種常見的特徵。這些特徵並非只與一種裝置類型綁定,可以視需求使用。
新增 trait
您之前定義了模型,現在改為新增特徵來更新模型。在這種情況下,請新增「開啟/關閉」特徵,控制連接到裝置的 LED 燈。
在 Actions 主控台中開啟專案。
選取左側導覽列的「裝置註冊」分頁標籤。
在清單中點選任一模式即可進行編輯。
按一下「支援的特徵」方塊中的鉛筆圖示,新增特徵。
勾選「開啟」OnOff核取方塊。按一下「儲存」。
請務必儲存模型的變更。再次點選「儲存」。
後續步驟
處理指令
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eGoogle Assistant utilizes "traits" to link user queries to device commands, requiring developers to define device capabilities within their device model.\u003c/p\u003e\n"],["\u003cp\u003eGoogle provides pre-built traits for common device functionalities, offering flexibility in implementation across various device types.\u003c/p\u003e\n"],["\u003cp\u003eTo add a trait, developers can access their device model through the Actions Console, select the desired trait from the available options, and save the changes.\u003c/p\u003e\n"],["\u003cp\u003eThe example demonstrates adding an On/Off trait for controlling an LED, illustrating the process of extending device functionality.\u003c/p\u003e\n"]]],["Device functionality is enabled by declaring supported abilities, known as traits, within a device model. These traits, provided by Google, are reusable across various devices. To add a trait, users must access the Actions Console, navigate to Device Registration, select a model, and edit its Supported traits. For instance, to add On/Off control for an LED, the OnOff trait is selected and saved in the device's model, with another save step to finalize.\n"],null,["# Register Traits\n\nThe Google Assistant needs to be able to associate a query with a\ncommand to send to your device. For this to work, you need to declare what kinds\nof abilities your device supports. These abilities are known as *traits*. You\ndeclare these traits within your device model.\n\nGoogle has already created a wide variety of common [traits](/assistant/sdk/reference/traits)\nfound on many devices. These traits are not tied to just one device type, you can\nuse them as you choose.\n\nAdd a trait\n-----------\n\nYou previously defined a model, now update it by adding a trait. In this case,\nadd an On/Off trait to control an LED attached to your device.\n\n1. Open the project in the [Actions Console](https://console.actions.google.com/).\n\n2. Select the **Device registration** tab from the left navbar.\n\n3. Click a model from the list to edit it.\n\n4. Click the pencil in the **Supported traits** box to add the trait.\n\n5. Select the **OnOff** checkbox. Click **SAVE**.\n\n6. Make sure to save changes to the model. Click **SAVE** again.\n\nNext step\n---------\n\n[Handle Commands](/assistant/sdk/guides/service/python/extend/handle-device-commands)"]]