Desconectar

Si el usuario desvincula tu Acción smart home de Google Assistant, tu entrega recibe un intent action.devices.DISCONNECT. Este intent indica que Assistant no enviará más intents para este usuario, y tu servicio en la nube debería dejar de llamar a las APIs de Google Home Graph (Request Sync y Report State) para sus dispositivos.

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

Para obtener más información, consulta la documentación de referencia del intent DISCONNECT.