1// Copyright 2022 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.home.graph.v1; 18 19import "google/protobuf/struct.proto"; 20 21option go_package = "google.golang.org/genproto/googleapis/home/graph/v1;graph"; 22option java_outer_classname = "DeviceProto"; 23option java_package = "com.google.home.graph.v1"; 24option php_namespace = "Google\\Home\\Graph\\V1"; 25 26// Third-party device definition. 27message Device { 28 // Third-party device ID. 29 string id = 1; 30 31 // Hardware type of the device. 32 // See [device 33 // types](https://developers.home.google.com/cloud-to-cloud/guides). 34 string type = 2; 35 36 // Traits supported by the device. 37 // See [device 38 // traits](https://developers.home.google.com/cloud-to-cloud/traits). 39 repeated string traits = 3; 40 41 // Names given to this device by your smart home Action. 42 DeviceNames name = 4; 43 44 // Indicates whether your smart home Action will report state of this device 45 // to Google via 46 // [ReportStateAndNotification][google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification]. 47 bool will_report_state = 5; 48 49 // Suggested name for the room where this device is installed. 50 // Google attempts to use this value during user setup. 51 string room_hint = 6; 52 53 // Suggested name for the structure where this device is installed. 54 // Google attempts to use this value during user setup. 55 string structure_hint = 7; 56 57 // Device manufacturer, model, hardware version, and software version. 58 DeviceInfo device_info = 8; 59 60 // Attributes for the traits supported by the device. 61 google.protobuf.Struct attributes = 9; 62 63 // Custom device attributes stored in Home Graph and provided to your 64 // smart home Action in each 65 // [QUERY](https://developers.home.google.com/cloud-to-cloud/intents/query) 66 // and 67 // [EXECUTE](https://developers.home.google.com/cloud-to-cloud/intents/execute) 68 // intent. 69 // Data in this object has a few constraints: No sensitive information, 70 // including but not limited to Personally Identifiable Information. 71 google.protobuf.Struct custom_data = 10; 72 73 // Alternate IDs associated with this device. 74 // This is used to identify cloud synced devices enabled for [local 75 // fulfillment](https://developers.home.google.com/local-home/overview). 76 repeated AgentOtherDeviceId other_device_ids = 11; 77 78 // Indicates whether your smart home Action will report notifications 79 // to Google for this device via 80 // [ReportStateAndNotification][google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification]. 81 // 82 // If your smart home Action enables users to control device notifications, 83 // you should update this field and call 84 // [RequestSyncDevices][google.home.graph.v1.HomeGraphApiService.RequestSyncDevices]. 85 bool notification_supported_by_agent = 12; 86} 87 88// Identifiers used to describe the device. 89message DeviceNames { 90 // Primary name of the device, generally provided by the user. 91 string name = 1; 92 93 // Additional names provided by the user for the device. 94 repeated string nicknames = 2; 95 96 // List of names provided by the manufacturer rather than the user, such as 97 // serial numbers, SKUs, etc. 98 repeated string default_names = 3; 99} 100 101// Device information. 102message DeviceInfo { 103 // Device manufacturer. 104 string manufacturer = 1; 105 106 // Device model. 107 string model = 2; 108 109 // Device hardware version. 110 string hw_version = 3; 111 112 // Device software version. 113 string sw_version = 4; 114} 115 116// Alternate third-party device ID. 117message AgentOtherDeviceId { 118 // Project ID for your smart home Action. 119 string agent_id = 1; 120 121 // Unique third-party device ID. 122 string device_id = 2; 123} 124