ลักษณะเฉพาะของการจดทะเบียน
Google Assistant ต้องเชื่อมโยงคำถามกับคำสั่งเพื่อส่งไปยังอุปกรณ์ของคุณได้ คุณต้องประกาศประเภทความสามารถ
ที่อุปกรณ์รองรับเพื่อให้ดำเนินการได้ ความสามารถเหล่านี้เรียกว่าลักษณะ โดยประกาศคุณสมบัติเหล่านี้ภายในรุ่นอุปกรณ์ของคุณ
Google ได้สร้างลักษณะทั่วไปที่หลากหลายซึ่งพบในอุปกรณ์จำนวนมากไว้แล้ว ลักษณะเหล่านี้ไม่ได้เชื่อมโยงกับอุปกรณ์เพียงประเภทเดียว คุณสามารถใช้ได้ตามต้องการ
เพิ่มลักษณะ
ก่อนหน้านี้คุณได้กำหนดโมเดลแล้ว โปรดอัปเดตโมเดลด้วยการเพิ่มลักษณะ ในกรณีนี้
ให้เพิ่มลักษณะการเปิด/ปิดเพื่อควบคุมไฟ LED ที่ต่ออยู่กับอุปกรณ์
เปิดโปรเจ็กต์ในคอนโซล Actions
เลือกแท็บการลงทะเบียนอุปกรณ์จากแถบนำทางด้านซ้าย
คลิกโมเดลจากรายการเพื่อแก้ไข
คลิกดินสอในช่องลักษณะที่รองรับเพื่อเพิ่มลักษณะ
เลือกช่องทำเครื่องหมาย OnOff คลิกบันทึก
ตรวจสอบว่าได้บันทึกการเปลี่ยนแปลงไปยังโมเดลแล้ว คลิกบันทึกอีกครั้ง
ขั้นตอนถัดไป
คำสั่งแฮนเดิล
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2023-12-02 UTC
[null,null,["อัปเดตล่าสุด 2023-12-02 UTC"],[[["Google Assistant utilizes \"traits\" to link user queries to device commands, requiring developers to define device capabilities within their device model."],["Google provides pre-built traits for common device functionalities, offering flexibility in implementation across various device types."],["To 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."],["The example demonstrates adding an On/Off trait for controlling an LED, illustrating the process of extending device functionality."]]],["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"]]