Package org.openhab.binding.fs20

Examples of org.openhab.binding.fs20.FS20BindingConfig


   */
  @Override
  public void processBindingConfiguration(String context, Item item,
      String bindingConfig) throws BindingConfigParseException {
    super.processBindingConfiguration(context, item, bindingConfig);
    FS20BindingConfig config = new FS20BindingConfig(bindingConfig, item);

    // parse bindingconfig here ...
    addressMap.put(config.getAddress(), config);
    addBindingConfig(item, config);
  }
View Full Code Here


  /**
   * @{inheritDoc
   */
  @Override
  protected void internalReceiveCommand(String itemName, Command command) {
    FS20BindingConfig bindingConfig = null;
    for (FS20BindingProvider provider : super.providers) {
      bindingConfig = provider.getConfigForItemName(itemName);
      if (bindingConfig != null) {
        break;
      }
    }
    if (bindingConfig != null) {
      logger.debug("Received command " + command.toString()
          + " for item " + itemName);
      try {
        FS20Command fs20Command = FS20CommandHelper
            .convertHABCommandToFS20Command(command);
        cul.send("F" + bindingConfig.getAddress()
            + fs20Command.getHexValue());
      } catch (CULCommunicationException e) {
        logger.error("An exception occured while sending a command", e);
      }
    }
View Full Code Here

  private void handleReceivedMessage(String message) {
    String houseCode = (message.substring(1, 5));
    String address = (message.substring(5, 7));
    String command = message.substring(7, 9);
    String fullAddress = houseCode + address;
    FS20BindingConfig config = null;
    for (FS20BindingProvider provider : providers) {
      config = provider.getConfigForAddress(fullAddress);
      if (config != null) {
        break;
      }
    }
    if (config != null) {
      FS20Command fs20Command = FS20Command.getFromHexValue(command);
      logger.debug("Received command " + fs20Command.toString()
          + " for device " + config.getAddress());
      eventPublisher.postUpdate(config.getItem().getName(),
          FS20CommandHelper.getStateFromFS20Command(fs20Command));
    } else {
      logger.debug("Received message for unknown device " + fullAddress);
    }
  }
View Full Code Here

TOP

Related Classes of org.openhab.binding.fs20.FS20BindingConfig

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.