Examples of DeviceOptions


Examples of org.openhab.binding.tinkerforge.internal.config.DeviceOptions

    // parse bindingconfig here ...
    if (bindingConfig == null) {
      logger.error("got bindingConfig null for item: {}", item.getName());
    } else {
      TinkerforgeBindingConfig config = new TinkerforgeBindingConfig();
            DeviceOptions deviceOptions = new DeviceOptions();
            String[] tokens = bindingConfig.trim().split(",");
      for (String token : tokens) {
        token = token.trim();
        logger.debug("token: {}", token);
        String[] confStatement = token.split("=");
        if (confStatement.length != 2) {
          throw new BindingConfigParseException(
              "TinkerforgeGenericBindingProvider:processBindingConfiguration: invalid format, the entry must consist of key=value pair, but value was found."
                  + token);
        } else {
          String key = confStatement[0];
          String value = confStatement[1];
          if (key.equals(ConfigKey.uid.name())) {
            config.setUid(value);
          } else if (key.equals(ConfigKey.subid.name())) {
            config.setSubId(value);
          } else if (key.equals(ConfigKey.name.name())) {
            config.setName(value);
          } else {
                      deviceOptions.put(key, value);
                      }
        }
      }
      config.setDeviceOptions(deviceOptions);
      config.setItem(item);
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.