forked from jens/Automation
Calendar trigger
This commit is contained in:
@ -515,7 +515,7 @@ public class Rule implements Comparable<Rule>
|
||||
{
|
||||
boolean isActuallyToggleable = isActuallyToggable();
|
||||
|
||||
boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
||||
// boolean notLastActive = getLastActivatedRule() == null || !getLastActivatedRule().equals(Rule.this);
|
||||
boolean doToggle = ruleToggle && isActuallyToggleable;
|
||||
|
||||
String message;
|
||||
@ -529,6 +529,29 @@ public class Rule implements Comparable<Rule>
|
||||
if(Settings.startNewThreadForRuleActivation)
|
||||
publishProgress(message);
|
||||
|
||||
/*
|
||||
Make a note of Rule/CalendarEvent executed combinations
|
||||
*/
|
||||
if(Rule.this.hasTriggerOfType(Trigger.Trigger_Enum.calendarEvent))
|
||||
{
|
||||
for(CalendarReceiver.CalendarEvent event : CalendarReceiver.getApplyingCalendarEvents(Rule.this))
|
||||
{
|
||||
if(!CalendarReceiver.hasEventBeenUsedInRule(Rule.this, event))
|
||||
{
|
||||
/*
|
||||
Record only the first calendar event that matched because the rule may
|
||||
be executed once for every matching event.
|
||||
*/
|
||||
Miscellaneous.logEvent("i", "Rule", "Executing this rule run for calender event: " + event, 5);
|
||||
CalendarReceiver.addUsedPair(new CalendarReceiver.RuleEventPair(Rule.this, event));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Run actions one after another
|
||||
*/
|
||||
for(int i = 0; i< Rule.this.getActionSet().size(); i++)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user