Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / Methods / unschedule.groovy
index 168962149f4a14c8840169d6af475f22f047aab0..22ff9228c2076f687474babaeded680bb2a68f25 100644 (file)
@@ -1,9 +1,29 @@
 /////////////////////////////////////////////////////////////////////
 ////unschedule(func)
 def unschedule(Closure functionToUnschedule) {
-       for (int i = 0;i < timersFuncList.size();i++) {
+       /*for (int i = 0;i < timersFuncList.size();i++) {
                if (timersFuncList[i] == functionToUnschedule) {
-                       timersList[i].cancel()
+                       if (timersList != null)
+                               timersList[i].cancel()
+               }
+       }*/
+}
+
+def unschedule(String nameOfFunctionToUnschedule) {
+       /*for (int i = 0;i < timersFuncList.size();i++) {
+               if (timersFuncList[i] instanceof String) {
+                       if (timersFuncList[i] == nameOfFunctionToUnschedule) {
+                               if (timersList != null)
+                                       timersList[i].cancel()
+                       }
                }
-       }
+       }*/
+}
+
+
+def unschedule() {
+       /*for (int i = 0;i < timersFuncList.size();i++) {
+               if (timersList != null)
+                       timersList[i].cancel()
+       }*/
 }