设备型号
设备型号由本部分中的字段定义。
设备型号字段只能包含字母、数字和以下符号:英文句点 (.)、连字符 (-)、下划线 (_)、空格 ( ) 和加号 (+)。字段的第一个字符必须是字母或数字。
{ "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
:(字符串)必需。此设备型号的全局唯一标识符;使用project_id
作为前缀,以帮助避免所有项目范围内发生冲突。在指标和设备注册期间使用。manifest
:(object(Manifest)) 必需。用于描述设备型号和制造商的元数据。这些内容可能会显示在(即将推出)SDK 控制台、指标信息中心和其他相关的可视化界面中。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>) 可选。设备支持的特征列表。特征包括设备的命令、属性和状态。您无需定义 Action 软件包即可使用 内置特征。
设备实例
设备实例由本部分中的字段定义。
设备实例字段必须以字母或数字开头。设备 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
:(字符串)必需。测试设备的标识符。在同一个 Google Developers 项目下注册的所有设备中必须是唯一的。model_id
:(字符串)必需。设备型号的标识符;必须与此测试设备关联的device_model_id
相同。设备型号必须之前已注册。nickname
:(字符串)可选。设备的别名。此名称将在 Google 助理设置等可视化界面中用于指代设备。client_type
:(字符串)必需。客户端设备的类型。必须是以下其中一项:SDK_SERVICE
或SDK_LIBRARY
。