Package org.openhab.core.types

Examples of org.openhab.core.types.State


    if (converter == null) {
      logger.warn("No converter found for item = {}, node = {} endpoint = {}, ignoring event.", item.getName(), event.getNodeId(), event.getEndpoint());
      return;
    }
   
    State state = converter.convertFromValueToState(event.getValue());
    this.getEventPublisher().postUpdate(item.getName(), state);
  }
View Full Code Here


    if (converter == null) {
      logger.warn("No converter found for item = {}, node = {} endpoint = {}, ignoring event.", item.getName(), event.getNodeId(), event.getEndpoint());
      return;
    }
   
    State itemState = converter.convertFromValueToState(event.getValue());
    this.getEventPublisher().postUpdate(item.getName(), itemState);
  }
View Full Code Here

    if (informationItem == null) {
      logger.warn("Incorrect information item specified. item name = {}", arguments.get("item"));
      return;
    }
   
        State state = UnDefType.UNDEF;

        // extract the appropriate information value
    Object value = getInformationItemValue(node, informationItem);       
        if (value != null) {       
            ZWaveStateConverter<?,?> converter = this.getStateConverter(item, value);
View Full Code Here

   
    // Don't trigger event if this item is bound to another sensor type
    if (sensorType != null && SensorType.getSensorType(Integer.parseInt(sensorType)) != sensorEvent.getSensorType())
      return;
   
    State state = converter.convertFromValueToState(event.getValue());
    this.getEventPublisher().postUpdate(item.getName(), state);
  }
View Full Code Here

  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

      }
    }
  }

  private State resolveCommand(Method method, String data) {
    State cmd = null;
    if (method == Method.TURNON) {
      cmd = OnOffType.ON;
    } else if (method == Method.TURNOFF) {
      cmd = OnOffType.OFF;
    } else if (method == Method.DIM) {
View Full Code Here

      double dValue = Double.valueOf(event.getData());
      TellstickValueSelector selector = device.getUsageSelector();
      if (selector == null) {
        selector = device.getValueSelector();
      }
      State cmd = getCommand(event, dValue, selector);
      sendToOpenHab(device.getItemName(), cmd);
    }
View Full Code Here

      State cmd = getCommand(event, dValue, selector);
      sendToOpenHab(device.getItemName(), cmd);
    }

    private State getCommand(TellstickSensorEvent event, double dValue, TellstickValueSelector selector) {
      State cmd = null;
      if (event.getDataType() == DataType.TEMPERATURE) {
        switch (selector) {
        case MOTION:
          cmd = OnOffType.ON;
          break;
View Full Code Here

    if (converter == null) {
      logger.warn("No converter found for item = {}, node = {} endpoint = {}, ignoring event.", item.getName(), event.getNodeId(), event.getEndpoint());
      return;
    }
   
    State state = converter.convertFromValueToState(event.getValue());
    this.getEventPublisher().postUpdate(item.getName(), state);
  }
View Full Code Here

      stateSubscriber = new MqttMessageSubscriber(brokerName + ":"
          + topic + ":state:default") {

        @Override
        public void processMessage(String topic, byte[] message) {
          State state;
          try {
            state = getState(new String(message));
          } catch (Exception e) {
            logger.error("Error parsing state from message.", e);
            return;
View Full Code Here

TOP

Related Classes of org.openhab.core.types.State

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.