Package org.openhab.binding.rfxcom.internal

Examples of org.openhab.binding.rfxcom.internal.RFXComException


      if (valueSelector == RFXComValueSelector.SIGNAL_LEVEL) {

        state = new DecimalType(signalLevel);

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to NumberItem");
      }

    } else if (valueSelector.getItemClass() == SwitchItem.class) {

      if (valueSelector == RFXComValueSelector.COMMAND) {

        switch (command) {
        case OFF:
        case GROUP_OFF:
        case DIM:
          state = OnOffType.OFF;
          break;

        case ON:
        case GROUP_ON:
        case BRIGHT:
          state = OnOffType.ON;
          break;

        case CHIME:
          state = OnOffType.ON;
          break;
         
        default:
          throw new RFXComException("Can't convert "
              + command + " to SwitchItem");
        }

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to SwitchItem");
      }

    } else if (valueSelector.getItemClass() == ContactItem.class) {

      if (valueSelector == RFXComValueSelector.CONTACT) {

        switch (command) {
        case OFF:
        case GROUP_OFF:
        case DIM:
          state = OpenClosedType.CLOSED;
          break;

        case ON:
        case GROUP_ON:
        case BRIGHT:
          state = OpenClosedType.OPEN;
          break;

        case CHIME:
          state = OpenClosedType.OPEN;
          break;
         
        default:
          throw new RFXComException("Can't convert "
              + command + " to ContactItem");
        }

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to ContactItem");
      }

    } else if (valueSelector.getItemClass() == StringItem.class) {

      if (valueSelector == RFXComValueSelector.RAW_DATA) {

        state = new StringType(
            DatatypeConverter.printHexBinary(rawMessage));

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to StringItem");
      }

    } else {

      throw new RFXComException("Can't convert " + valueSelector
          + " to " + valueSelector.getItemClass());

    }

    return state;
View Full Code Here


          command = (type == OnOffType.ON ? Commands.GROUP_ON : Commands.GROUP_OFF);
        } else {       
          command = (type == OnOffType.ON ? Commands.ON : Commands.OFF);
        }
      } else {
        throw new RFXComException("Can't convert " + type + " to Command");
      }
      break;

    default:
      throw new RFXComException("Can't convert " + type + " to " + valueSelector);
    }

  }
View Full Code Here

      if (s.toString().equals(subType)) {
        return s;
      }
    }

    throw new RFXComException("Unknown sub type " + subType);
  }
View Full Code Here

      } else if (valueSelector == RFXComValueSelector.BATTERY_LEVEL) {

        state = new DecimalType(batteryLevel);

      } else {
        throw new RFXComException("Can't convert " + valueSelector
            + " to NumberItem");
      }

    } else if (valueSelector.getItemClass() == RollershutterItem.class) {
View Full Code Here

        throw new NumberFormatException("Can't convert " + type + " to Command");
      }
      break;

    default:
      throw new RFXComException("Can't convert " + type + " to "
          + valueSelector);
    }
  }
View Full Code Here

      if (s.toString().equals(subType)) {
        return s;
      }
    }
   
    throw new RFXComException("Unknown sub type " + subType);
  }
View Full Code Here

      } else if (valueSelector == RFXComValueSelector.BATTERY_LEVEL) {

        state = new DecimalType(batteryLevel);

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to NumberItem");
      }

    } else if (valueSelector.getItemClass() == RollershutterItem.class) {

      if (valueSelector == RFXComValueSelector.COMMAND) {

        switch (command) {
        case CLOSE:
          state = OpenClosedType.CLOSED;
          break;

        case OPEN:
          state = OpenClosedType.OPEN;
          break;
         
        default:
          break;
        }

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to SwitchItem");
      }

    } else if (valueSelector.getItemClass() == StringItem.class) {

      if (valueSelector == RFXComValueSelector.RAW_DATA) {

        state = new StringType(
            DatatypeConverter.printHexBinary(rawMessage));

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to StringItem");
      }

    } else {

      throw new RFXComException("Can't convert " + valueSelector
          + " to " + valueSelector.getItemClass());

    }

    return state;
View Full Code Here

        command = (type == UpDownType.UP ? Commands.CLOSE : Commands.OPEN);
      } else if (type instanceof StopMoveType) {
        command = Commands.STOP;
       
      } else {
        throw new RFXComException("Can't convert " + type + " to Command");
      }
      break;

    default:
      throw new RFXComException("Can't convert " + type + " to " + valueSelector);
    }
   
  }
View Full Code Here

      if (s.toString().equals(subType)) {
        return s;
      }
    }
   
    throw new RFXComException("Unknown sub type " + subType);
  }
View Full Code Here

      } else if (valueSelector == RFXComValueSelector.HUMIDITY) {

        state = new DecimalType(humidity);

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to NumberItem");
      }

    } else if (valueSelector.getItemClass() == StringItem.class) {

      if (valueSelector == RFXComValueSelector.RAW_DATA) {

        state = new StringType(
            DatatypeConverter.printHexBinary(rawMessage));

      } else if (valueSelector == RFXComValueSelector.HUMIDITY_STATUS) {

        state = new StringType(humidityStatus.toString());

      } else {
        throw new RFXComException("Can't convert "
            + valueSelector + " to StringItem");
      }
    } else {

      throw new RFXComException("Can't convert " + valueSelector
          + " to " + valueSelector.getItemClass());

    }

    return state;
View Full Code Here

TOP

Related Classes of org.openhab.binding.rfxcom.internal.RFXComException

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.