class Devices extends Resource (View source)

The "devices" collection of methods.

Typical usage is:

 $homegraphService = new Google\Service\HomeGraphService(...);
 $devices = $homegraphService->devices;

Methods

query(QueryRequest $postBody, array $optParams = [])

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.

reportStateAndNotification(ReportStateAndNotificationRequest $postBody, array $optParams = [])

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 for more information. This method updates the device state according to its declared 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.

requestSync(RequestSyncDevicesRequest $postBody, array $optParams = [])

Requests Google to send an action.devices.SYNC intent 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. (devices.requestSync)

sync(SyncRequest $postBody, array $optParams = [])

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).

Details

QueryResponse query(QueryRequest $postBody, array $optParams = [])

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.

(devices.query)

Parameters

QueryRequest $postBody
array $optParams

Optional parameters.

Return Value

QueryResponse

Exceptions

Exception

ReportStateAndNotificationResponse reportStateAndNotification(ReportStateAndNotificationRequest $postBody, array $optParams = [])

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 for more information. This method updates the device state according to its declared 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.

(devices.reportStateAndNotification)

Parameters

ReportStateAndNotificationRequest $postBody
array $optParams

Optional parameters.

Return Value

ReportStateAndNotificationResponse

Exceptions

Exception

RequestSyncDevicesResponse requestSync(RequestSyncDevicesRequest $postBody, array $optParams = [])

Requests Google to send an action.devices.SYNC intent 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. (devices.requestSync)

Parameters

RequestSyncDevicesRequest $postBody
array $optParams

Optional parameters.

Return Value

RequestSyncDevicesResponse

Exceptions

Exception

SyncResponse sync(SyncRequest $postBody, array $optParams = [])

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. (devices.sync)

Parameters

SyncRequest $postBody
array $optParams

Optional parameters.

Return Value

SyncResponse

Exceptions

Exception