X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Methods%2Fschedule.groovy;h=307b221e25c3f2a89cd3f6f3981ec78648d5252d;hb=76acd359abf5953c851c105b0b58bff07d717f3e;hp=6089a06ac3021c4b0add77c8b29d396bde3e87ff;hpb=6b2556e42d662151c71027292986099a0fd44514;p=smartthings-infrastructure.git diff --git a/Methods/schedule.groovy b/Methods/schedule.groovy index 6089a06..307b221 100644 --- a/Methods/schedule.groovy +++ b/Methods/schedule.groovy @@ -15,9 +15,8 @@ def schedule(String time, String nameOfFunction) { //} else { // delay = inputTime-currentTime //} - - //timersFuncList.add(nameOfFunction) - //timersList.add(new SimulatedTimer()) + timersFuncList.add(nameOfFunction) + timersList.add(new SimulatedTimer()) def task = timersList[timersFuncList.indexOf(nameOfFunction)].runAfter(/*delay*1000*0*/0) { "$nameOfFunction"() } @@ -26,7 +25,7 @@ def schedule(String time, String nameOfFunction) { def schedule(String time, Closure nameOfFunction) { //def _inputTime = time.split(':') //Date date = new Date() - def _currentTime = date.format("HH:mm:ss").split(':') + //def _currentTime = date.format("HH:mm:ss").split(':') //Convert input time and current time to minutes //def inputTime = Integer.parseInt(_inputTime[0])*3600+Integer.parseInt(_inputTime[1])*60