From 1ff4a15818299b8f24fcb5285b06160286a0781e Mon Sep 17 00:00:00 2001 From: jens Date: Thu, 18 Jan 2024 16:28:42 +0100 Subject: [PATCH] Calendar trigger --- .../java/com/jens/automation2/receivers/CalendarReceiver.java | 4 +++- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java b/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java index e0b00d7..e6900c8 100644 --- a/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java +++ b/app/src/main/java/com/jens/automation2/receivers/CalendarReceiver.java @@ -65,6 +65,8 @@ 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) { @@ -621,7 +623,7 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis for(Trigger t : rule.getTriggerSet()) { - if(t.getTriggerType().equals(calendarEvents)) + if(t.getTriggerType().equals(Trigger.Trigger_Enum.calendarEvent)) { for (CalendarReceiver.CalendarEvent event : calendarEvents) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8029fac..eb0817d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -939,5 +939,5 @@ event is not reoccurring event is reoccurring reoccurring - If your calendar holds multiple events in parallel, a rule would get executed as many time as there are events. The same goes for eventsthat directly follow each other. + If your calendar holds multiple events in parallel, a rule would get executed as many time as there are events matching the rule\'s criteria. Also for events that directly follow each other a rule with a matching event trigger would get executed twice.\nOnly in case a rule has multiple calendar triggers and there are multiple matching events in parallel the rule will get executed only once. \ No newline at end of file