裝置型號
裝置型號是由本節中的欄位定義。
裝置型號欄位只能包含英文字母、數字和下列符號:句號 (.)、連字號 (-)、底線 (_)、空格 ( ) 和加號 (+)。欄位的第一個字元必須為字母或數字。
{ "project_id": "my-devices-project", "device_model_id": "my-devices-project-prototype-light-v1", "manifest": { "manufacturer": "Assistant SDK developer", "product_name": "Assistant SDK light", "device_description": "Assistant SDK light device" }, "device_type": "action.devices.types.LIGHT", "traits": ["action.devices.traits.OnOff"] }
{ "project_id": string, "device_model_id": string, "manifest": { "manufacturer": string, "product_name": string, "device_description": string }, "device_type": string, "traits": [ string ] }
project_id
: (字串) 必填。Actions 主控台專案的 Google Cloud Platform 專案 ID,要與這個裝置型號建立關聯。一個專案可以包含多個裝置型號。device_model_id
: (字串) 必填。這個裝置型號的全域不重複 ID;使用project_id
做為前置字串,避免所有專案的範圍發生衝突。用於指標和裝置註冊期間。manifest
: (物件(資訊清單)) 為必要欄位。說明裝置型號和製造商的中繼資料。這可能會顯示在 (即將推出) SDK Console、指標資訊主頁和其他相關的視覺介面中。manifest.manufacturer
: (字串) 必填。裝置製造商名稱manifest.product_name
: (字串) 必填。此裝置型號的消費者產品名稱。manifest.device_description
: (字串) 選填。此裝置型號的說明。
device_type
: (字串) 必填。裝置硬體類型。請選取下列選項:action.devices.types.CAMERA
action.devices.types.DISHWASHER
action.devices.types.DRYER
action.devices.types.LIGHT
action.devices.types.OUTLET
action.devices.types.PHONE
action.devices.types.REFRIGERATOR
action.devices.types.SCENE
action.devices.types.SOUNDBAR
action.devices.types.SPEAKER
action.devices.types.SWITCH
action.devices.types.THERMOSTAT
action.devices.types.TV
action.devices.types.VACUUM
action.devices.types.WASHER
traits
: (Array<String>) 選用。裝置支援的 traits 清單。特徵包括裝置的指令、屬性和狀態。您不需要定義動作套件,即可使用 內建特徵。
裝置執行個體
裝置執行個體是由本節中的欄位定義。
裝置執行個體欄位的開頭必須是英文字母或數字。裝置 ID 只能包含英文字母、數字和以下符號:句號 (.)、連字號 (-)、底線 (_) 和加號 (+)。裝置暱稱只能包含數字、字母和空格 ( )。
{ "id": "my_led_1", "model_id": "my-devices-project-prototype-light-v1", "nickname": "My Assistant Light", "client_type": "SDK_LIBRARY" }
{ "id": string, "model_id": string, "nickname": string, "client_type": string }
id
: (字串) 必填。測試裝置的 ID。在相同 Google Developers 專案中註冊的所有裝置中,均不得重複。model_id
: (字串) 必填。裝置型號的 ID;必須與與此測試裝置相關聯的device_model_id
相同。先前已註冊這個裝置型號。nickname
: (字串) 選填。裝置的暱稱。這個名稱會用來在 Google 助理設定等視覺介面中指稱裝置。client_type
: (字串) 必填。用戶端裝置類型。必須是下列其中一項:SDK_SERVICE
或SDK_LIBRARY
。