package eu.hsrw.ias.ggd;

import HttpCall.HttpPost;

public class Isis {

  public static String OnCallMethod(String deviceName, String sensorName)
    throws Exception {
    //CONFIG PARAMETERS:
    //BEGIN------------CONFIG PARAMETERS BELOW TO YOUR ENVIRONMENT---------------------------------------
    String baseURL =
      "https://api.dev.whysor.com/devices/readValueFromSpeech?access_token=2MreqC9fqXxFHJBEcrCL38LKhEaVcEHmEi6o45CwTV9SSgTAuZ93oiMfY3HVc2fj";
    final String body = String.format(
      "{\"deviceName\": \"%s\", \"sensorName\": \"%s\", \"domain\": \"my.yookr.org\"}",
      deviceName,
      sensorName
    );
    HttpPost httpMethodPost = new HttpPost();
    httpMethodPost.HttpCallPost(baseURL, body);

    return httpMethodPost.HttpCallPost(baseURL, body);
  }

  public static void main(String[] args) {
    try {
      String output = OnCallMethod("Greenhouse 1", "status");
      System.out.println(output);
    } catch (Exception e) {
      e.printStackTrace();
    }

  }
}
