Examples of TellstickDevice


Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

    // BindingProviders provide a binding for the given 'itemName'.
    logger.debug("internalReceiveCommand() is called! for " + itemName + " with " + command);
    TellstickBindingConfig config = findTellstickBindingConfig(itemName);
    if (config != null) {
      try {
        TellstickDevice dev = findDevice(config);
        controller.handleSendEvent(config, dev, command);
      } catch (Exception e) {
        logger.error("Failed to send msg to " + config, e);
      }
    }
View Full Code Here

Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

      }
    }
  }

  private TellstickDevice findDevice(TellstickBindingConfig config) {
    TellstickDevice dev = null;
    for (TellstickBindingProvider prov : providers) {
      dev = ((TellstickBindingProvider) prov).getDevice(config.getItemName());
      if (dev != null) {
        break;
      }
View Full Code Here

Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

      handleDeviceEvent(newDevices);
    }
  }

  private void handleDeviceEvent(TellstickDeviceEvent event) {
    TellstickDevice device = event.getDevice();
    controller.setLastSend(System.currentTimeMillis());
    logger.debug("Got deviceEvent for " + device + " name:" + device + " method" + event.getMethod());
    if (device != null) {
      State cmd = resolveCommand(event.getMethod(), event.getData());
      TellstickBindingConfig conf = findTellstickBindingConfig(device.getId(), null);
      if (conf != null) {
        sendToOpenHab(conf.getItemName(), cmd);
      } else {
        logger.info("Could not find config for " + device);
      }
View Full Code Here

Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

  private void refreshFromTellstick() {
    logger.trace("Update with telldus state");
    for (TellstickBindingProvider prov : providers) {
      for (String name : prov.getItemNames()) {
        TellstickDevice dev = prov.getDevice(name);
        if (dev != null) {
          Method method = Method.getMethodById(dev.getStatus());
          sendToOpenHab(name, resolveCommand(method, dev.getData()));
        }

      }
    }
    lastRefresh = System.currentTimeMillis();
View Full Code Here

Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

    String[] configParts = bindingConfig.trim().split(":");

    if (configParts.length < 1) {
      throw new BindingConfigParseException("Tellstick binding must contain two parts separated by ':'");
    }
    TellstickDevice device;
    try {
      device = findDevice(configParts[0].trim());
    } catch (SupportedMethodsException e) {
      throw new BindingConfigParseException(e.getMessage());
    }
    validateBinding(item, configParts, device);

    if (device == null) {
      config.setId(Integer.valueOf(configParts[0].trim()));
    } else {
      config.setId(device.getId());
    }

    config.setValueSelector(TellstickValueSelector.getValueSelector(configParts[1].trim()));
    if (configParts.length > 2 && configParts[2].trim().length() > 0) {
      config.setUsageSelector(TellstickValueSelector.getValueSelector(configParts[2].trim()));
View Full Code Here

Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

          + configParts[3].trim() + " not a number");
    }
  }

  private TellstickDevice findDevice(String deviceIdent) throws SupportedMethodsException {
    TellstickDevice result = null;
    if (allDevices == null) {
      updateDevices();
    }
    for (TellstickDevice device : allDevices) {
      if (device.getName().equals(deviceIdent)) {
View Full Code Here

Examples of org.openhab.binding.tellstick.internal.device.TellstickDevice

    return (TellstickBindingConfig) bindingConfigs.get(itemName);
  }

  @Override
  public TellstickDevice getDevice(String itemName) {
    TellstickDevice res = null;

    TellstickBindingConfig conf = getTellstickBindingConfig(itemName);
    if (conf != null) {
      for (TellstickDevice device : getAllDevices()) {
        if (device.getId() == conf.getId()) {
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.