blob: 15bbbcd58e4ea22c5902f065eb56a3a2032bce4a [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="homegraph_v1.html">HomeGraph API</a> . <a href="homegraph_v1.devices.html">devices</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#query">query(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070082<p class="firstline">Gets the current states in Home Graph for the given set of the third-party user's devices. The third-party user's identity is passed in via the `agent_user_id` (see QueryRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070083<p class="toc_element">
84 <code><a href="#reportStateAndNotification">reportStateAndNotification(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070086<p class="toc_element">
yoshi-code-bot69706592021-03-03 03:54:02 -080087 <code><a href="#requestLink">requestLink(body=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Sends an account linking suggestion to users associated with any potential Cast devices detected by third-party devices. This request must be authorized using service account credentials from your Actions console project.</p>
89<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070090 <code><a href="#requestSync">requestSync(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070091<p class="firstline">Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070092<p class="toc_element">
93 <code><a href="#sync">sync(body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070094<p class="firstline">Gets all the devices associated with the given third-party user. The third-party user's identity is passed in via the `agent_user_id` (see SyncRequest). This request must be authorized using service account credentials from your Actions console project.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070095<h3>Method Details</h3>
96<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070097 <code class="details" id="close">close()</code>
98 <pre>Close httplib2 connections.</pre>
99</div>
Bu Sun Kim65020912020-05-20 12:08:20 -0700100
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700101<div class="method">
102 <code class="details" id="query">query(body=None, x__xgafv=None)</code>
103 <pre>Gets the current states in Home Graph for the given set of the third-party user&#x27;s devices. The third-party user&#x27;s identity is passed in via the `agent_user_id` (see QueryRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700104
105Args:
106 body: object, The request body.
107 The object takes the form of:
108
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700109{ # Request type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800110 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
111 &quot;inputs&quot;: [ # Required. Inputs containing third-party device IDs for which to get the device states.
112 { # Device ID inputs to QueryRequest.
113 &quot;payload&quot;: { # Payload containing device IDs. # Payload containing third-party device IDs.
114 &quot;devices&quot;: [ # Third-party device IDs for which to get the device states.
115 { # Third-party device ID for one device.
116 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
117 },
118 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700119 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800120 },
121 ],
122 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
123}
Bu Sun Kim65020912020-05-20 12:08:20 -0700124
125 x__xgafv: string, V1 error format.
126 Allowed values
127 1 - v1 error format
128 2 - v2 error format
129
130Returns:
131 An object of the form:
132
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700133 { # Response type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call. This should follow the same format as the Google smart home `action.devices.QUERY` [response](https://developers.google.com/assistant/smarthome/reference/intent/query). # Example ```json { &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;, &quot;payload&quot;: { &quot;devices&quot;: { &quot;123&quot;: { &quot;on&quot;: true, &quot;online&quot;: true }, &quot;456&quot;: { &quot;on&quot;: true, &quot;online&quot;: true, &quot;brightness&quot;: 80, &quot;color&quot;: { &quot;name&quot;: &quot;cerulean&quot;, &quot;spectrumRGB&quot;: 31655 } } } } } ```
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800134 &quot;payload&quot;: { # Payload containing device states information. # Device states for the devices given in the request.
135 &quot;devices&quot;: { # States of the devices. Map of third-party device ID to struct of device states.
136 &quot;a_key&quot;: {
137 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700138 },
139 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800140 },
141 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
142}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700143</div>
144
145<div class="method">
146 <code class="details" id="reportStateAndNotification">reportStateAndNotification(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700147 <pre>Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user&#x27;s identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700148
149Args:
150 body: object, The request body.
151 The object takes the form of:
152
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700153{ # Request type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call. It may include states, notifications, or both. States and notifications are defined per `device_id` (for example, &quot;123&quot; and &quot;456&quot; in the following example). # Example ```json { &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;, &quot;agentUserId&quot;: &quot;1234&quot;, &quot;payload&quot;: { &quot;devices&quot;: { &quot;states&quot;: { &quot;123&quot;: { &quot;on&quot;: true }, &quot;456&quot;: { &quot;on&quot;: true, &quot;brightness&quot;: 10 } }, } } } ```
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800154 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
155 &quot;eventId&quot;: &quot;A String&quot;, # Unique identifier per event (for example, a doorbell press).
156 &quot;followUpToken&quot;: &quot;A String&quot;, # Token to maintain state in the follow up notification response. Deprecated. See the [notifications guide](https://developers.google.com/assistant/smarthome/develop/notifications) for details on implementing follow up notifications.
157 &quot;payload&quot;: { # Payload containing the state and notification information for devices. # Required. State of devices to update and notification metadata for devices.
158 &quot;devices&quot;: { # The states and notifications specific to a device. # The devices for updating state and sending notifications.
159 &quot;notifications&quot;: { # Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).
160 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
161 },
162 &quot;states&quot;: { # States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).
163 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700164 },
165 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800166 },
167 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
168}
Bu Sun Kim65020912020-05-20 12:08:20 -0700169
170 x__xgafv: string, V1 error format.
171 Allowed values
172 1 - v1 error format
173 2 - v2 error format
174
175Returns:
176 An object of the form:
177
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700178 { # Response type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800179 &quot;requestId&quot;: &quot;A String&quot;, # Request ID copied from ReportStateAndNotificationRequest.
180}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700181</div>
182
183<div class="method">
yoshi-code-bot69706592021-03-03 03:54:02 -0800184 <code class="details" id="requestLink">requestLink(body=None, x__xgafv=None)</code>
185 <pre>Sends an account linking suggestion to users associated with any potential Cast devices detected by third-party devices. This request must be authorized using service account credentials from your Actions console project.
186
187Args:
188 body: object, The request body.
189 The object takes the form of:
190
191{ # Request type for the [`RequestLink`](#google.home.graph.v1.HomeGraphApiService.RequestLink) call.
192 &quot;payload&quot;: { # Payload containing potential devices detected and when they were detected. # Required. ID(s) and detection time of potential Cast devices.
193 &quot;detectionTime&quot;: &quot;A String&quot;, # Required. Time at which devices represented in `potential_cast_device_ids` were detected.
194 &quot;potentialCastDeviceIds&quot;: [ # Required. List of device IDs detected that may potentially be for Cast devices.
195 &quot;A String&quot;,
196 ],
197 },
198 &quot;requestId&quot;: &quot;A String&quot;, # Required. Request ID used for debugging.
199}
200
201 x__xgafv: string, V1 error format.
202 Allowed values
203 1 - v1 error format
204 2 - v2 error format
205
206Returns:
207 An object of the form:
208
209 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
210}</pre>
211</div>
212
213<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700214 <code class="details" id="requestSync">requestSync(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700215 <pre>Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user&#x27;s identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700216
217Args:
218 body: object, The request body.
219 The object takes the form of:
220
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700221{ # Request type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800222 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
223 &quot;async&quot;: True or False, # Optional. If set, the request will be added to a queue and a response will be returned immediately. This enables concurrent requests for the given `agent_user_id`, but the caller will not receive any error responses.
224}
Bu Sun Kim65020912020-05-20 12:08:20 -0700225
226 x__xgafv: string, V1 error format.
227 Allowed values
228 1 - v1 error format
229 2 - v2 error format
230
231Returns:
232 An object of the form:
233
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700234 { # Response type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call. Intentionally empty upon success. An HTTP response code is returned with more details upon failure.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800235}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700236</div>
237
238<div class="method">
239 <code class="details" id="sync">sync(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700240 <pre>Gets all the devices associated with the given third-party user. The third-party user&#x27;s identity is passed in via the `agent_user_id` (see SyncRequest). This request must be authorized using service account credentials from your Actions console project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700241
242Args:
243 body: object, The request body.
244 The object takes the form of:
245
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700246{ # Request type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800247 &quot;agentUserId&quot;: &quot;A String&quot;, # Required. Third-party user ID.
248 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging.
249}
Bu Sun Kim65020912020-05-20 12:08:20 -0700250
251 x__xgafv: string, V1 error format.
252 Allowed values
253 1 - v1 error format
254 2 - v2 error format
255
256Returns:
257 An object of the form:
258
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700259 { # Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call. This should follow the same format as the Google smart home `action.devices.SYNC` [response](https://developers.google.com/assistant/smarthome/reference/intent/sync). # Example ```json { &quot;requestId&quot;: &quot;ff36a3cc-ec34-11e6-b1a0-64510650abcf&quot;, &quot;payload&quot;: { &quot;agentUserId&quot;: &quot;1836.15267389&quot;, &quot;devices&quot;: [{ &quot;id&quot;: &quot;123&quot;, &quot;type&quot;: &quot;action.devices.types.OUTLET&quot;, &quot;traits&quot;: [ &quot;action.devices.traits.OnOff&quot; ], &quot;name&quot;: { &quot;defaultNames&quot;: [&quot;My Outlet 1234&quot;], &quot;name&quot;: &quot;Night light&quot;, &quot;nicknames&quot;: [&quot;wall plug&quot;] }, &quot;willReportState&quot;: false, &quot;deviceInfo&quot;: { &quot;manufacturer&quot;: &quot;lights-out-inc&quot;, &quot;model&quot;: &quot;hs1234&quot;, &quot;hwVersion&quot;: &quot;3.2&quot;, &quot;swVersion&quot;: &quot;11.4&quot; }, &quot;customData&quot;: { &quot;fooValue&quot;: 74, &quot;barValue&quot;: true, &quot;bazValue&quot;: &quot;foo&quot; } }] } } ```
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800260 &quot;payload&quot;: { # Payload containing device information. # Devices associated with the third-party user.
261 &quot;agentUserId&quot;: &quot;A String&quot;, # Third-party user ID
262 &quot;devices&quot;: [ # Devices associated with the third-party user.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800263 { # Third-party device definition. Next ID = 14
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800264 &quot;attributes&quot;: { # Attributes for the traits supported by the device.
265 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
266 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800267 &quot;customData&quot;: { # Custom device attributes stored in Home Graph and provided to your smart home Action in each [QUERY](https://developers.google.com/assistant/smarthome/reference/intent/query) and [EXECUTE](https://developers.google.com/assistant/smarthome/reference/intent/execute) intent. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800268 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
269 },
270 &quot;deviceInfo&quot;: { # Device information. # Device manufacturer, model, hardware version, and software version.
271 &quot;hwVersion&quot;: &quot;A String&quot;, # Device hardware version.
272 &quot;manufacturer&quot;: &quot;A String&quot;, # Device manufacturer.
273 &quot;model&quot;: &quot;A String&quot;, # Device model.
274 &quot;swVersion&quot;: &quot;A String&quot;, # Device software version.
275 },
276 &quot;id&quot;: &quot;A String&quot;, # Third-party device ID.
277 &quot;name&quot;: { # Identifiers used to describe the device. # Names given to this device by your smart home Action.
278 &quot;defaultNames&quot;: [ # List of names provided by the manufacturer rather than the user, such as serial numbers, SKUs, etc.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800279 &quot;A String&quot;,
280 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800281 &quot;name&quot;: &quot;A String&quot;, # Primary name of the device, generally provided by the user.
282 &quot;nicknames&quot;: [ # Additional names provided by the user for the device.
283 &quot;A String&quot;,
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800284 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700285 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800286 &quot;nonLocalTraits&quot;: [ # See description for &quot;traits&quot;. For Smart Home Entertainment Devices (SHED) devices, some traits can only be executed on 3P cloud, e.g. &quot;non_local_traits&quot;: [ { &quot;trait&quot;: &quot;action.devices.traits.MediaInitiation&quot; }, { &quot;trait&quot;: &quot;action.devices.traits.Channel&quot; } ] go/shed-per-trait-routing.
287 { # LINT.IfChange go/shed-per-trait-routing. Making it object to allow for extendible design, where we can add attributes in future.
288 &quot;trait&quot;: &quot;A String&quot;, # Trait name, e.g., &quot;action.devices.traits.MediaInitiation&quot;. See [device traits](https://developers.google.com/assistant/smarthome/traits).
289 },
290 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800291 &quot;notificationSupportedByAgent&quot;: True or False, # Indicates whether your smart home Action will report notifications to Google for this device via ReportStateAndNotification. If your smart home Action enables users to control device notifications, you should update this field and call RequestSyncDevices.
292 &quot;otherDeviceIds&quot;: [ # Alternate IDs associated with this device. This is used to identify cloud synced devices enabled for [local fulfillment](https://developers.google.com/assistant/smarthome/concepts/local).
293 { # Alternate third-party device ID.
294 &quot;agentId&quot;: &quot;A String&quot;, # Project ID for your smart home Action.
295 &quot;deviceId&quot;: &quot;A String&quot;, # Unique third-party device ID.
296 },
297 ],
298 &quot;roomHint&quot;: &quot;A String&quot;, # Suggested name for the room where this device is installed. Google attempts to use this value during user setup.
299 &quot;structureHint&quot;: &quot;A String&quot;, # Suggested name for the structure where this device is installed. Google attempts to use this value during user setup.
300 &quot;traits&quot;: [ # Traits supported by the device. See [device traits](https://developers.google.com/assistant/smarthome/traits).
301 &quot;A String&quot;,
302 ],
303 &quot;type&quot;: &quot;A String&quot;, # Hardware type of the device. See [device types](https://developers.google.com/assistant/smarthome/guides).
304 &quot;willReportState&quot;: True or False, # Indicates whether your smart home Action will report state of this device to Google via ReportStateAndNotification.
305 },
306 ],
307 },
308 &quot;requestId&quot;: &quot;A String&quot;, # Request ID used for debugging. Copied from the request.
309}</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700310</div>
311
312</body></html>