Examples of HmValueItem


Examples of org.openhab.binding.homematic.internal.model.HmValueItem

  /**
   * Called on startup or when some binding has changed, for example if a item
   * file is reloaded. Publishes the current States to openHAB.
   */
  public void publishChangedItemToOpenhab(Item item, HomematicBindingConfig bindingConfig) {
    HmValueItem hmValueItem = context.getStateHolder().getState(bindingConfig);
    if (hmValueItem != null) {
      Converter<?> converter = context.getConverterFactory().createConverter(item, bindingConfig);
      if (converter != null) {
        State state = converter.convertFromBinding(hmValueItem);
        context.getEventPublisher().postUpdate(item.getName(), state);
View Full Code Here

Examples of org.openhab.binding.homematic.internal.model.HmValueItem

  /**
   * Returns all possible value items from the remote control.
   */
  private String[] getValueItems(String parameterName) {
    DatapointConfig dpConfig = new DatapointConfig(remoteControlAddress, "18", parameterName);
    HmValueItem hmValueItem = context.getStateHolder().getState(dpConfig);
    if (hmValueItem != null) {
      String[] valueList = (String[]) ArrayUtils.remove(hmValueItem.getValueList(), 0);
      int onIdx = ArrayUtils.indexOf(valueList, "ON");
      if (onIdx != -1) {
        valueList[onIdx] = parameterName + "_ON";
      }
      return valueList;
View Full Code Here

Examples of org.openhab.binding.homematic.internal.model.HmValueItem

      if (diff > MIN_AGE) {
        new ProviderItemIterator().iterate(entry.getKey(), new ProviderItemIteratorCallback() {

          @Override
          public void next(HomematicBindingConfig providerBindingConfig, Item item, Converter<?> converter) {
            HmValueItem hmValueItem = context.getStateHolder().getState(providerBindingConfig);
            if (providerBindingConfig instanceof ProgramConfig
                || providerBindingConfig instanceof ActionConfig) {
              context.getEventPublisher().postUpdate(item.getName(), OnOffType.OFF);
            } else {
              hmValueItem.setValue(converter.convertToBinding(OnOffType.OFF, hmValueItem));
              State state = converter.convertFromBinding(hmValueItem);
              context.getEventPublisher().postUpdate(item.getName(), state);
            }
            logger.debug("Disabled Item {} with binding {}", item.getName(), providerBindingConfig);
          }
View Full Code Here

Examples of org.openhab.binding.homematic.internal.model.HmValueItem

  /**
   * Returns the cached HmValueItem.
   */
  public HmValueItem getState(HomematicBindingConfig bindingConfig) {
    HmValueItem hmValueItem = datapoints.get(bindingConfig);
    if (hmValueItem == null) {
      hmValueItem = variables.get(bindingConfig);
    }
    return hmValueItem;
  }
View Full Code Here

Examples of org.openhab.binding.homematic.internal.model.HmValueItem

  /**
   * Upates the RSSI datapoint if available.
   */
  private void updateRssiInfo(DatapointConfig bindingConfig, Integer rssiValue) {
    HmValueItem valueItem = datapoints.get(bindingConfig);
    if (valueItem != null) {
      if (!valueItem.getValue().equals(rssiValue)) {
        logger.debug("Value changed from '{}' to '{}' for binding {}",
            valueItem == null ? "null" : valueItem.getValue(), rssiValue, bindingConfig);
        valueItem.setValue(rssiValue);
        publish(bindingConfig, valueItem);
      }
    } else {
      logger.debug("Rssi info not found: {}", bindingConfig);
    }
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.