TimeFrame repetition fix
This commit is contained in:
		@@ -334,6 +334,15 @@ public class Rule implements Comparable<Rule>
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
 | 
								if (oneTrigger.hasStateNotAppliedSinceLastRuleExecution())
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								/*
 | 
				
			||||||
 | 
									Workaround for repetition in TimeFrame triggers
 | 
				
			||||||
 | 
								 */
 | 
				
			||||||
 | 
								if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame))
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									if(oneTrigger.getTimeFrame().repetition > 0)
 | 
				
			||||||
 | 
										return true;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -894,7 +894,7 @@ public class Trigger
 | 
				
			|||||||
										Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
 | 
															Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
 | 
				
			||||||
												&&
 | 
																	&&
 | 
				
			||||||
										(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
 | 
															(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
 | 
				
			||||||
														|
 | 
																			||
 | 
				
			||||||
										Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
 | 
															Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
 | 
				
			||||||
								)
 | 
													)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -266,7 +266,6 @@ public class DateTimeListener extends BroadcastReceiver implements AutomationLis
 | 
				
			|||||||
		Intent alarmIntent = new Intent(automationServiceRef, DateTimeListener.class);
 | 
							Intent alarmIntent = new Intent(automationServiceRef, DateTimeListener.class);
 | 
				
			||||||
		PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
 | 
							PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(automationServiceRef, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
 | 
				
			||||||
		centralAlarmManagerInstance.set(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
 | 
							centralAlarmManagerInstance.set(AlarmManager.RTC_WAKEUP, scheduleCandidate.time.getTimeInMillis(), alarmPendingIntent);
 | 
				
			||||||
		
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm");
 | 
							SimpleDateFormat sdf = new SimpleDateFormat("E dd.MM.yyyy HH:mm");
 | 
				
			||||||
		Calendar calendar = Calendar.getInstance();
 | 
							Calendar calendar = Calendar.getInstance();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ buildscript {
 | 
				
			|||||||
        jcenter()
 | 
					        jcenter()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    dependencies {
 | 
					    dependencies {
 | 
				
			||||||
        classpath 'com.android.tools.build:gradle:7.1.1'
 | 
					        classpath 'com.android.tools.build:gradle:7.1.2'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // NOTE: Do not place your application dependencies here; they belong
 | 
					        // NOTE: Do not place your application dependencies here; they belong
 | 
				
			||||||
        // in the individual module build.gradle files
 | 
					        // in the individual module build.gradle files
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user