Changes in classes: new concept for latest value + all types of events generated...
[smartthings-infrastructure.git] / eventSimulator / eventSimulator.groovy
1 while(true) {
2         def eventNumber = Verify.getInt(0,5)
3         switch(eventNumber) {
4                 case 0:
5                         def event = Verify.getInt(0,1)
6                         if (event == 0) {
7                                         switchObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
8                                                         displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
9                         } else {
10                                         switchObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
11                                                         displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
12                         }
13                         break
14                 case 1:
15                         break
16                 case 2:
17                         colorControlObject.setValue([name: "hue", value: "50", deviceId: "colorControlID0", descriptionText: "",
18                                         displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
19                         break
20                 case 3:
21                         colorControlObject.setValue([name: "saturation", value: "50", deviceId: "colorControlID0", descriptionText: "",
22                                         displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
23                         break
24                 case 4:
25                         break
26                 case 5:
27                         break
28         }
29 }