device.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Copyright 2020 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. syntax = "proto3";
  15. package google.home.graph.v1;
  16. import "google/protobuf/struct.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/home/graph/v1;graph";
  18. option java_outer_classname = "DeviceProto";
  19. option java_package = "com.google.home.graph.v1";
  20. option php_namespace = "Google\\Home\\Graph\\V1";
  21. // Third-party device definition.
  22. message Device {
  23. // Third-party device ID.
  24. string id = 1;
  25. // Hardware type of the device.
  26. // See [device
  27. // types](https://developers.google.com/assistant/smarthome/guides).
  28. string type = 2;
  29. // Traits supported by the device.
  30. // See [device
  31. // traits](https://developers.google.com/assistant/smarthome/traits).
  32. repeated string traits = 3;
  33. // Names given to this device by your smart home Action.
  34. DeviceNames name = 4;
  35. // Indicates whether your smart home Action will report state of this device
  36. // to Google via
  37. // [ReportStateAndNotification][google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification].
  38. bool will_report_state = 5;
  39. // Suggested name for the room where this device is installed.
  40. // Google attempts to use this value during user setup.
  41. string room_hint = 6;
  42. // Suggested name for the structure where this device is installed.
  43. // Google attempts to use this value during user setup.
  44. string structure_hint = 7;
  45. // Device manufacturer, model, hardware version, and software version.
  46. DeviceInfo device_info = 8;
  47. // Attributes for the traits supported by the device.
  48. google.protobuf.Struct attributes = 9;
  49. // Custom device attributes stored in Home Graph and provided to your
  50. // smart home Action in each
  51. // [QUERY](https://developers.google.com/assistant/smarthome/reference/intent/query)
  52. // and
  53. // [EXECUTE](https://developers.google.com/assistant/smarthome/reference/intent/execute)
  54. // intent.
  55. google.protobuf.Struct custom_data = 10;
  56. // Alternate IDs associated with this device.
  57. // This is used to identify cloud synced devices enabled for [local
  58. // fulfillment](https://developers.google.com/assistant/smarthome/concepts/local).
  59. repeated AgentOtherDeviceId other_device_ids = 11;
  60. // Indicates whether your smart home Action will report notifications
  61. // to Google for this device via
  62. // [ReportStateAndNotification][google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification].
  63. //
  64. // If your smart home Action enables users to control device notifications,
  65. // you should update this field and call
  66. // [RequestSyncDevices][google.home.graph.v1.HomeGraphApiService.RequestSyncDevices].
  67. bool notification_supported_by_agent = 12;
  68. }
  69. // Identifiers used to describe the device.
  70. message DeviceNames {
  71. // Primary name of the device, generally provided by the user.
  72. string name = 1;
  73. // Additional names provided by the user for the device.
  74. repeated string nicknames = 2;
  75. // List of names provided by the manufacturer rather than the user, such as
  76. // serial numbers, SKUs, etc.
  77. repeated string default_names = 3;
  78. }
  79. // Device information.
  80. message DeviceInfo {
  81. // Device manufacturer.
  82. string manufacturer = 1;
  83. // Device model.
  84. string model = 2;
  85. // Device hardware version.
  86. string hw_version = 3;
  87. // Device software version.
  88. string sw_version = 4;
  89. }
  90. // Alternate third-party device ID.
  91. message AgentOtherDeviceId {
  92. // Project ID for your smart home Action.
  93. string agent_id = 1;
  94. // Unique third-party device ID.
  95. string device_id = 2;
  96. }