Examples of DSID


Examples of org.openhab.binding.digitalstrom.internal.client.entity.DSID

 
  private void parseValue(DigitalSTROMBindingConfigEnum configKey, String valueStr) {
    switch (configKey) {
   
    case dsid:
      this.dsid = new DSID(valueStr);
      break;
    case consumption:
      try {
        this.consumption = ConsumptionConfig.valueOf(valueStr);
      }catch (Exception e) {
        logger.error("WRONG consumption type: "+valueStr+"; "+e.getLocalizedMessage());
      }
      if (consumption == null) {
        this.consumption = ConsumptionConfig.ACTIVE_POWER;
      }
      break;
   
    case timeinterval:
      int interval = -1;
      try {
        interval = Integer.parseInt(valueStr);
      } catch (java.lang.NumberFormatException e) {
        logger.error("Numberformat exception by parsing a string to int in timeinterval: "+valueStr);
      }
      if (interval != -1) {
        this.timeinterval = interval;
      }
      break;
    case dsmid:
      this.dsmid = new DSID(valueStr);
      break;
    case context:
      if (valueStr.toLowerCase().equals(ContextConfig.slat.name())) {
        this.context = ContextConfig.slat;
      }
View Full Code Here

Examples of org.openhab.binding.digitalstrom.internal.client.entity.DSID

    if (object.get(JSONApiResponseKeysEnum.DEVICE_NAME.getKey()) != null) {
      this.name = object.get(JSONApiResponseKeysEnum.DEVICE_NAME.getKey()).toString();
    }
   
    if (object.get(JSONApiResponseKeysEnum.DEVICE_ID.getKey()) != null) {
      this.dsid = new DSID(object.get(JSONApiResponseKeysEnum.DEVICE_ID.getKey()).toString());
    }
    else if (object.get(JSONApiResponseKeysEnum.DEVICE_ID_QUERY.getKey()) != null) {
      this.dsid = new DSID(object.get(JSONApiResponseKeysEnum.DEVICE_ID_QUERY.getKey()).toString());
    }
   
    if (object.get(JSONApiResponseKeysEnum.DEVICE_ON.getKey()) != null) {
      this.isOn = object.get(JSONApiResponseKeysEnum.DEVICE_ON.getKey()).toString().equals("true");
    }
View Full Code Here

Examples of org.openhab.binding.digitalstrom.internal.client.entity.DSID

  private double  value = 0;
  private String date = null;
 
  public JSONCachedMeteringValueImpl(JSONObject jObject) {
    if (jObject.get(JSONApiResponseKeysEnum.METERING_GET_LATEST_DSID.getKey()) != null) {
      this.dsid = new DSID(jObject.get(JSONApiResponseKeysEnum.METERING_GET_LATEST_DSID.getKey()).toString());
    }
   
    if (jObject.get(JSONApiResponseKeysEnum.METERING_GET_LATEST_VALUE.getKey()) != null) {
      try {
        this.value = Double.parseDouble(jObject.get(JSONApiResponseKeysEnum.METERING_GET_LATEST_VALUE.getKey()).toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.