Many fixes

This commit is contained in:
2025-07-18 19:05:42 +02:00
parent c7557519e8
commit fb64c46c95
11 changed files with 43 additions and 11 deletions

View File

@@ -509,12 +509,20 @@ public class CalendarReceiver extends BroadcastReceiver implements AutomationLis
Calendar now = Calendar.getInstance();
List<CalendarEvent> events = readCalendarEvents(Miscellaneous.getAnyContext(), true, false);
if(events.size() == 0)
{
Miscellaneous.logEvent("i", "calculateNextWakeup()", "Supposedly no future events in calendar. Reading again...", 4);
events = readCalendarEvents(Miscellaneous.getAnyContext(), true, false);
}
if (events.size() == 0)
{
Miscellaneous.logEvent("i", "calculateNextWakeup()", "No future events, nothing to schedule.", 4);
}
else
{
Miscellaneous.logEvent("i", "calculateNextWakeup()", String.valueOf(events.size()) + " future events in calendar. Checking if one applies.", 4);
List<Rule> ruleCandidates = Rule.findRuleCandidates(Trigger.Trigger_Enum.calendarEvent);
List<Long> wakeUpCandidatesList = new ArrayList<>();