歡迎使用 Google Home 開發人員中心,探索全新功能,瞭解如何開發智慧住宅動作。注意:請繼續在「動作」控制台中建立動作。

中斷連線

透過集合功能整理內容 你可以依據偏好儲存及分類內容。

如果使用者取消您的smart home Action from Google Assistant , your fulfillment receives an action.devices.DISCONNECT intent. This intent indicates that Assistant will not send any more intents for this user, and your cloud service should stop calling Google Home Graph APIs (Request Sync and Report State ) for their devices.

請求
{
    "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
    "inputs": [{
      "intent": "action.devices.DISCONNECT",
    }]
}
JSON
{}
Node.js
const {smarthome} = require('actions-on-google');
const app = smarthome();
// ...
app.onDisconnect((body, headers) => {
  // TODO Disconnect user account from Google Assistant
  // You can return an empty body
  return {};
});
Java
@Override
public void onDisconnect(
    @NotNull DisconnectRequest disconnectRequest, @Nullable Map<?, ?> map) {
  // TODO Disconnect user account from Google Assistant
  // This function does not return anything
}

詳情請參閱 DISCONNECT 意圖參考說明文件。