Package org.openhab.binding.plugwise.internal

Examples of org.openhab.binding.plugwise.internal.Energy


    if(matcher.matches()) {
      MAC = matcher.group(1);
      datapoints = new Energy[4];

      if(!matcher.group(2).equals("FFFFFFFF")){
        datapoints[0] = new Energy(matcher.group(2), Long.parseLong(matcher.group(3), 16), 3600);
      }
      else {
        datapoints[0] = null;
      }
      if(!matcher.group(4).equals("FFFFFFFF")){
        datapoints[1] = new Energy(matcher.group(2), Long.parseLong(matcher.group(5), 16), 3600);
      }
      else {
        datapoints[1] = null;
      }
      if(!matcher.group(6).equals("FFFFFFFF")){
        datapoints[2] = new Energy(matcher.group(2), Long.parseLong(matcher.group(7), 16), 3600);
      }
      else {
        datapoints[2] = null;
      }
      if(!matcher.group(8).equals("FFFFFFFF")){
        datapoints[3] = new Energy(matcher.group(2), Long.parseLong(matcher.group(9), 16), 3600);
      }
      else {
        datapoints[3] = null;
      }
View Full Code Here


    Pattern RESPONSE_PATTERN = Pattern.compile("(\\w{16})(\\w{4})(\\w{4})(\\w{8})(\\w{4})(\\w{4})(\\w{4})");

    Matcher matcher = RESPONSE_PATTERN.matcher(payLoad);
    if(matcher.matches()) {
      MAC = matcher.group(1);
      oneSecond = new Energy(DateTime.now(), Integer.parseInt(matcher.group(2), 16), 1);
      eightSecond = new Energy(DateTime.now(), Integer.parseInt(matcher.group(3), 16), 8);
      allSeconds = new Energy(DateTime.now(), Integer.parseInt(matcher.group(4), 16), 0);
      unknown1 = Integer.parseInt(matcher.group(5), 16);
      unknown2 = Integer.parseInt(matcher.group(6), 16);
      unknown3 = Integer.parseInt(matcher.group(7), 16);

    }
View Full Code Here

TOP

Related Classes of org.openhab.binding.plugwise.internal.Energy

Copyright © 2018 www.massapicom. 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.