Package org.openhab.core.events

Examples of org.openhab.core.events.EventPublisher.postUpdate()


            Item item = registry.getItemByPattern(itemName);
            if(args.length>1) {
              String stateName = args[1];
              State state = TypeParser.parseState(item.getAcceptedDataTypes(), stateName);
              if(state!=null) {
                publisher.postUpdate(item.getName(), state);
                console.println("Update has been sent successfully.");
              } else {
                console.println("Error: State '" + stateName +
                    "' is not valid for item '" + itemName + "'");
                console.print("Valid data types are: ( ");
View Full Code Here


    EventPublisher publisher = (EventPublisher) RulesActivator.eventPublisherTracker.getService();
    if(publisher!=null && registry!=null) {
      try {
        Item item = registry.getItem(itemName);
        State state = TypeParser.parseState(item.getAcceptedDataTypes(), stateString);
        publisher.postUpdate(itemName, state);
      } catch (ItemNotFoundException e) {
        logger.warn("Item '" + itemName + "' does not exist.");
      }
    }
  }
View Full Code Here

    EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
    if(publisher!=null && registry!=null) {
      try {
        Item item = registry.getItem(itemName);
        State state = TypeParser.parseState(item.getAcceptedDataTypes(), stateString);
        publisher.postUpdate(itemName, state);
      } catch (ItemNotFoundException e) {
        logger.warn("Item '" + itemName + "' does not exist.");
      }
    }
    return null;
View Full Code Here

   * @param state the new state of the item
   */
  static public Object postUpdate(Item item, State state) {
    EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
    if (publisher!=null && item != null) {
      publisher.postUpdate(item.getName(), state);
    }
    return null;
  }

  /**
 
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.