Commit #9: More classes + Extractor with Rahmadi's editions + Fixing some bugs
[smartthings-infrastructure.git] / eventSimulator / eventSimulator.groovy
1 def events = [1,2,3,4,5,6,7]
2 def list = events.permutations()
3 int count = Verify.getInt(0,list.size()-1)
4 println "COUNT: " + count
5
6 list[count].each {
7   switch(it) {
8     case 1:
9       appObject.setValue([name: "Touched", value: "Touched", deviceId: 0, descriptionText: "",
10                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
11       println "1"
12       break
13     case 2:
14       lockObject.setValue([name: "lock0", value: "locked", deviceId: 0, descriptionText: "",
15                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
16       println "   2"
17                         break
18     case 3:
19       lockObject.setValue([name: "lock0", value: "unlocked", deviceId: 0, descriptionText: "",
20                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
21       println "      3"
22       break
23     case 4:
24       contactObject.setValue([name: "contact0", value: "open", deviceId: 0, descriptionText: "",
25                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
26       println "         4"
27       break
28     case 5:
29       contactObject.setValue([name: "contact0", value: "closed", deviceId: 0, descriptionText: "",
30                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
31       println "            5"
32       break
33     case 6:
34       switchObject.setValue([name: "switch0", value: "on", deviceId: 0, descriptionText: "",
35                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
36       println "               6"
37       break
38     case 7:
39       switchObject.setValue([name: "switch0", value: "off", deviceId: 0, descriptionText: "",
40                                            displayed: true, linkText: "", isStateChange: false, unit: "", data: []])
41       println "                   7"
42     default:
43       break
44   }
45 }