Commit #9: More classes + Extractor with Rahmadi's editions + Fixing some bugs
[smartthings-infrastructure.git] / Methods / schedule.groovy
index be935b8efdda6196c475c14a7b732699194f0ab5..3981f5466b6bc0bf373f42dbc6194a740c63f9cc 100644 (file)
@@ -18,7 +18,7 @@ def schedule(String time, String nameOfFunction) {
 
        timersFuncList.add(nameOfFunction)
        timersList.add(new SimulatedTimer())
-       def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*1000) {
+       def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*1000*0) {
                "$nameOfFunction"()
        }
 }
@@ -41,10 +41,10 @@ def schedule(String time, Closure nameOfFunction) {
 
        if (timersFuncList.contains(nameOfFunction)) {
                timersList[timersFuncList.indexOf(nameOfFunction)].cancel()
-               def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*seconds, nameOfFunction)
+               def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*seconds*0, nameOfFunction)
        } else {
                timersFuncList.add(nameOfFunction)
                timersList.add(new SimulatedTimer())
-               def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*seconds, nameOfFunction)
+               def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(delay*seconds*0, nameOfFunction)
        }
 }