Exemple #1
0
  @Override
  public Response getResponse(Context context, String hypothesis, AdkManager adkManager) {

    if (hypothesis.contains(ON)) {

      adkManager.write(SERIAL_ON);

      return new Response()
          .setReply(
              Response.getRandomReply(
                  context.getResources().getStringArray(R.array.component_on_default)));

    } else if (hypothesis.contains(OFF)) {

      adkManager.write(SERIAL_OFF);

      return new Response()
          .setReply(
              Response.getRandomReply(
                  context.getResources().getStringArray(R.array.component_off_default)));

    } else {

      return new Response()
          .setReply(
              Response.getRandomReply(
                  context.getResources().getStringArray(R.array.component_default)))
          .setNestedLexicon(Arrays.asList(new ComponentOn(), new ComponentOff()));
    }
  }
Exemple #2
0
    @Override
    public Response getResponse(Context context, String hypothesis, AdkManager adkManager) {

      adkManager.write(SERIAL_ON);

      return new Response()
          .setReply(
              Response.getRandomReply(
                  context.getResources().getStringArray(R.array.component_on_default)));
    }