7f6ca1fdf920128f08737d042126e2675a6c810a
[smartthings-infrastructure.git] / Methods / unschedule.groovy
1 /////////////////////////////////////////////////////////////////////
2 ////unschedule(func)
3 def unschedule(Closure functionToUnschedule) {
4         for (int i = 0;i < timersFuncList.size();i++) {
5                 if (timersFuncList[i] == functionToUnschedule) {
6                         if (timersList != null)
7                                 timersList[i].cancel()
8                 }
9         }
10 }
11
12 def unschedule(String nameOfFunctionToUnschedule) {
13         for (int i = 0;i < timersFuncList.size();i++) {
14                 if (timersFuncList[i] instanceof String) {
15                         if (timersFuncList[i] == nameOfFunctionToUnschedule) {
16                                 if (timersList != null)
17                                         timersList[i].cancel()
18                         }
19                 }
20         }
21 }
22
23
24 def unschedule() {
25         for (int i = 0;i < timersFuncList.size();i++) {
26                 if (timersList != null)
27                         timersList[i].cancel()
28         }
29 }