Skip to content

Commit

Permalink
[automation] Fix the created cron to run only once at the trigger min…
Browse files Browse the repository at this point in the history
…ute. (openhab#1162)

Fixes openhab#1156

Signed-off-by: Feras AlManna <firas.almanna3@gmail.com>
  • Loading branch information
falmanna authored and cweitkamp committed Oct 23, 2019
1 parent 2430256 commit 144fc8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import java.text.MessageFormat;

import org.eclipse.smarthome.core.scheduler.CronScheduler;
import org.eclipse.smarthome.core.scheduler.ScheduledCompletableFuture;
import org.eclipse.smarthome.core.scheduler.SchedulerRunnable;
import org.openhab.core.automation.ModuleHandlerCallback;
import org.openhab.core.automation.Trigger;
import org.openhab.core.automation.handler.BaseTriggerModuleHandler;
import org.openhab.core.automation.handler.TriggerHandlerCallback;
import org.eclipse.smarthome.core.scheduler.ScheduledCompletableFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -49,7 +49,7 @@ public TimeOfDayTriggerHandler(Trigger module, CronScheduler scheduler) {
String time = module.getConfiguration().get(CFG_TIME).toString();
try {
String[] parts = time.split(":");
expression = MessageFormat.format("* {1} {0} * * *", Integer.parseInt(parts[0]),
expression = MessageFormat.format("0 {1} {0} * * *", Integer.parseInt(parts[0]),
Integer.parseInt(parts[1]));
} catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {
throw new IllegalArgumentException("'time' parameter '" + time + "' is not in valid format 'hh:mm'.", e);
Expand Down

0 comments on commit 144fc8b

Please sign in to comment.