Disconnetti

Se l'utente scollega l'azione smart home daGoogle Assistant, l'erogazione riceve un intento action.devices.DISCONNECT. Questo intento indica che Assistant non invierà più intent per questo utente e il tuo servizio cloud dovrebbe interrompere le chiamate alle API Google Home Graph (Request Sync e Report State) per i suoi dispositivi.

Richiesta
{
    "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
}

Per ulteriori informazioni, consulta la documentazione di riferimento per gli intent DISCONNECT.