Examples of RFXComException


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

    if (valueSelector.getItemClass() == NumberItem.class) {
      if (valueSelector == RFXComValueSelector.SIGNAL_LEVEL) {
        state = new DecimalType(signalLevel);
      } else {
        throw new RFXComException("Can't convert " + valueSelector
            + " to NumberItem");
      }

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

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

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

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

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

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

  @Override
  public void convertFromState(RFXComValueSelector valueSelector, String id,
      Object subType, Type type, byte seqNumber) throws RFXComException {
   
    throw new RFXComException("Not supported");
  }
View Full Code Here

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

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

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

  @Override
  public State convertToState(RFXComValueSelector valueSelector)
      throws RFXComException {
   
    throw new RFXComException("Not supported");
  }
View Full Code Here

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

  @Override
  public void convertFromState(RFXComValueSelector valueSelector, String id,
      Object subType, Type type, byte seqNumber) throws RFXComException {
   
    throw new RFXComException("Not supported");
  }
View Full Code Here

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

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

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:
          state = OnOffType.OFF;
          break;

        case ON:
        case GROUP_ON:
          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:
          state = OpenClosedType.CLOSED;
          break;

        case ON:
        case GROUP_ON:
          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

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

    switch (valueSelector) {
    case COMMAND:
      if (type instanceof OnOffType) {
        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
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.