Calendar trigger

This commit is contained in:
2024-01-06 17:25:27 +01:00
parent 223cca442d
commit ec62b91449
17 changed files with 264 additions and 169 deletions

View File

@ -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)