Examples of UrtsiBindingProvider


Examples of org.openhab.binding.urtsi.UrtsiBindingProvider

   * @return Returns true, if the command has been executed successfully.
   *         Returns false otherwise.
   * @throws BindingConfigParseException
   */
  private boolean sendToUrtsi(String itemName, Type type) {
    UrtsiBindingProvider provider = null;
    if (!providers.isEmpty()) {
      provider = providers.iterator().next();
    }
    if (provider == null) {
      if (logger.isErrorEnabled()) {
        logger.error("doesn't find matching binding provider [itemName={}, type={}]", itemName, type);
      }
      return false;
    }
    String urtsiDeviceId = provider.getDeviceId(itemName);
    UrtsiDevice urtsiDevice = idToDeviceMap.get(urtsiDeviceId);
   
    if (urtsiDevice == null) {
      if (logger.isErrorEnabled()) {
        logger.error("No serial port has been configured for urtsi device id '" + urtsiDeviceId +"'");
      }
      return false;
    }
   
    int channel = provider.getChannel(itemName);
    int address = provider.getAddress(itemName);
   
    if (urtsiDevice != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Send to URTSI for item: " + itemName + "; Type: " + type);
      }
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.