Package org.openhab.model.rule.rules

Examples of org.openhab.model.rule.rules.CommandEventTrigger


      if(newType instanceof Command) {
        Command command = (Command) newType;
        for(Rule rule : rules) {
          for(EventTrigger t : rule.getEventtrigger()) {
            if (t instanceof CommandEventTrigger) {
              CommandEventTrigger ct = (CommandEventTrigger) t;
              Command triggerCommand = TypeParser.parseCommand(item.getAcceptedCommandTypes(), ct.getCommand());
              if(ct.getItem().equals(item.getName()) &&
                  (triggerCommand==null || command.equals(triggerCommand))) {
                result.add(rule);
              }
            }
          }
View Full Code Here


      if(t instanceof SystemOnStartupTrigger) {
        systemStartupTriggeredRules.add(rule);
      } else if(t instanceof SystemOnShutdownTrigger) {
        systemShutdownTriggeredRules.add(rule);
      } else if(t instanceof CommandEventTrigger) {
        CommandEventTrigger ceTrigger = (CommandEventTrigger) t;
        Set<Rule> rules = commandEventTriggeredRules.get(ceTrigger.getItem());
        if(rules==null) {
          rules = new HashSet<Rule>();
          commandEventTriggeredRules.put(ceTrigger.getItem(), rules);
        }
        rules.add(rule);
      } else if(t instanceof UpdateEventTrigger) {
        UpdateEventTrigger ueTrigger = (UpdateEventTrigger) t;
        Set<Rule> rules = updateEventTriggeredRules.get(ueTrigger.getItem());
        if(rules==null) {
          rules = new HashSet<Rule>();
          updateEventTriggeredRules.put(ueTrigger.getItem(), rules);
        }
        rules.add(rule);
      } else if(t instanceof ChangedEventTrigger) {
        ChangedEventTrigger ceTrigger = (ChangedEventTrigger) t;
        Set<Rule> rules = changedEventTriggeredRules.get(ceTrigger.getItem());
        if(rules==null) {
          rules = new HashSet<Rule>();
          changedEventTriggeredRules.put(ceTrigger.getItem(), rules);
        }
        rules.add(rule);
      } else if(t instanceof TimerTrigger) {
        timerEventTriggeredRules.add(rule);
        try {
View Full Code Here

TOP

Related Classes of org.openhab.model.rule.rules.CommandEventTrigger

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.