Calendar trigger
This commit is contained in:
		| @@ -344,7 +344,16 @@ public class Rule implements Comparable<Rule> | ||||
| 			if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.timeFrame)) | ||||
| 			{ | ||||
| 				if(oneTrigger.getTimeFrame().repetition > 0) | ||||
| 					return true; | ||||
| 				{ | ||||
| 					if(this.getLastExecution() != null) | ||||
| 					{ | ||||
| 						Calendar now = Calendar.getInstance(); | ||||
| 						if (this.getLastExecution().getTimeInMillis() + oneTrigger.getTimeFrame().getRepetition() * 1000 <= now.getTimeInMillis()) | ||||
| 							return true; | ||||
| 					} | ||||
| 					else | ||||
| 						return true; | ||||
| 				} | ||||
| 			} | ||||
| 			else if(oneTrigger.getTriggerType().equals(Trigger.Trigger_Enum.broadcastReceived)) | ||||
| 			{ | ||||
| @@ -372,7 +381,7 @@ public class Rule implements Comparable<Rule> | ||||
|  | ||||
| 		return false; | ||||
| 	} | ||||
| 	 | ||||
|  | ||||
| 	public boolean applies(Context context) | ||||
| 	{ | ||||
| 		if(AutomationService.getInstance() == null) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user