Examples of JointSpaceBindingProvider


Examples of org.openhab.binding.jointspace.JointSpaceBindingProvider

   */
  @Override
  protected void internalReceiveCommand(String itemName, Command command) {

    if (itemName != null && !this.providers.isEmpty()) {
      JointSpaceBindingProvider provider = this.providers.iterator().next();

      if (provider == null) {
        logger.warn("Doesn't find matching binding provider [itemName={}, command={}]", itemName, command);
        return;
      }

      logger.debug("Received command (item='{}', state='{}', class='{}')",
          new Object[] { itemName, command.toString(), command.getClass().toString() });

      String tvCommandString = null;

      // first check if we can translate the command directly
      tvCommandString = provider.getTVCommand(itemName, command.toString());

      // if not try some special notations
      if (tvCommandString == null) {
        if (command instanceof HSBType) {
          tvCommandString = provider.getTVCommand(itemName, "HSB");
        } else if (command instanceof DecimalType) {
          tvCommandString = provider.getTVCommand(itemName, "DEC");
        }
        if (tvCommandString == null) {
          tvCommandString = provider.getTVCommand(itemName, "*");
        }
      }

      if (tvCommandString == null) {
        logger.warn("Unrecognized command \"{}\"", command.toString());
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.