Examples of DPTXlatorBoolean


Examples of tuwien.auto.calimero.dptxlator.DPTXlatorBoolean

       *  Following code section deals with specific mapping of values from KNX to openHAB types were the String
       *  received from the DPTXlator is not sufficient to set the openHAB type or has bugs   
       */
      switch (mainNumber) {
      case 1:
        DPTXlatorBoolean translatorBoolean = (DPTXlatorBoolean) translator;
        switch (subNumber) {
        case 8:
          return translatorBoolean.getValueBoolean() ? UpDownType.DOWN:UpDownType.UP;
        case 9:
          return translatorBoolean.getValueBoolean() ? OpenClosedType.OPEN:OpenClosedType.CLOSED;
        case 10:
          return translatorBoolean.getValueBoolean() ? StopMoveType.MOVE:StopMoveType.STOP;
        case 19:
          return translatorBoolean.getValueBoolean() ? OpenClosedType.OPEN:OpenClosedType.CLOSED;
        case 22:
          return DecimalType.valueOf(translatorBoolean.getValueBoolean() ? "1": "0");
        default:
          return translatorBoolean.getValueBoolean() ? OnOffType.ON:OnOffType.OFF;
        }
      case 2:
        DPTXlator1BitControlled translator1BitControlled =  (DPTXlator1BitControlled) translator;
        int decValue= (translator1BitControlled.getControlBit() ? 2:0) + (translator1BitControlled.getValueBit() ? 1:0) ;
        return new DecimalType (decValue);
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.