Calendar trigger
This commit is contained in:
@ -65,8 +65,6 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis
|
||||
|
||||
public static void addUsedPair(RuleEventPair pair)
|
||||
{
|
||||
//TODO: Rule with multiple calendar events should be executed only once
|
||||
|
||||
// Add pair only if it's not in the list already.
|
||||
for(RuleEventPair usedPair : calendarEventsUsed)
|
||||
{
|
||||
@ -593,12 +591,20 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis
|
||||
{
|
||||
if (!hasEventBeenUsedInRule(rule, event))
|
||||
{
|
||||
Miscellaneous.logEvent("i", "mayRuleStillBeActivatedForPendingCalendarEvents()", "Rule " + rule.getName() + " has not been used in conjunction with event " + event, 4);
|
||||
return true;
|
||||
/*
|
||||
If there are multiple parallel calendar events and a rule has multiple
|
||||
triggers of type calendar event, we don't want the rule to fire only once.
|
||||
*/
|
||||
if(rule.getAmountOfTriggersForType(Trigger.Trigger_Enum.calendarEvent) == 1)
|
||||
{
|
||||
Miscellaneous.logEvent("i", "mayRuleStillBeActivatedForPendingCalendarEvents()", "Rule " + rule.getName() + " has not been used in conjunction with event " + event, 4);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user