Package org.openhab.binding.plcbus.internal.protocol

Examples of org.openhab.binding.plcbus.internal.protocol.IPLCBusController


    if (config == null) {
      logger.error("No config found for item %s", itemName);
      return;
    }

    IPLCBusController controller = PLCBusController.create(serialPortGateway);
    if (command == OnOffType.ON) {
      controller.switchOn(config.getUnit());
    } else if (command == OnOffType.OFF) {
      controller.switchOff(config.getUnit());
    } else if (command == IncreaseDecreaseType.INCREASE) {
      controller.bright(config.getUnit(), config.getSeconds());
    } else if (command == IncreaseDecreaseType.DECREASE) {
      controller.dim(config.getUnit(), config.getSeconds());
    } else if (command == StopMoveType.STOP) {
      controller.fadeStop(config.getUnit());
    } else if (command == UpDownType.UP) {
      controller.switchOn(config.getUnit());
    } else if (command == UpDownType.DOWN) {
      controller.switchOff(config.getUnit());
    }
  }
View Full Code Here


    if (config == null) {
      logger.error("No config found for %s", itemName);
      return;
    }

    IPLCBusController controller = PLCBusController.create(serialPortGateway);

    if (newState == UnDefType.UNDEF) {
      StatusResponse response = controller.requestStatusFor(config.getUnit());

      State status = (response.isUnitOn()) ? OnOffType.ON : OnOffType.OFF;
      this.eventPublisher.postUpdate(itemName, status);
    }
  }
View Full Code Here

TOP

Related Classes of org.openhab.binding.plcbus.internal.protocol.IPLCBusController

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.