Fixing the previous commit bugs! Adding required classes + required methods
[smartthings-infrastructure.git] / eventSimulator / eventSimulator.groovy
index 0a047739aa821ee8434030d7fbcf8dc68fe31728..ed622393e673656686ca2d9aa219f9fa232882dc 100644 (file)
@@ -1,29 +1,46 @@
 while(true) {
-       def eventNumber = Verify.getInt(0,5)
+       def eventNumber = Verify.getInt(0,9)
        switch(eventNumber) {
                case 0:
-                       def event = Verify.getInt(0,1)
+                       def event = Verify.getInt(0,2)
                        if (event == 0) {
-                                       switchObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
+                                       locationObject.setValue([name: "Location", value: "home", deviceId: "locationID0", descriptionText: "",
+                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+                       } else if (event == 1) {
+                                       locationObject.setValue([name: "Location", value: "away", deviceId: "locationID0", descriptionText: "",
                                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        } else {
-                                       switchObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
+                                       locationObject.setValue([name: "Location", value: "night", deviceId: "locationID0", descriptionText: "",
                                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        }
                        break
                case 1:
+                       contactObject.setValue([name: "contact.open", value: "open", deviceId: "contactSensorID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        break
                case 2:
-                       colorControlObject.setValue([name: "hue", value: "50", deviceId: "colorControlID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        break
                case 3:
-                       colorControlObject.setValue([name: "saturation", value: "50", deviceId: "colorControlID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        break
                case 4:
                        break
                case 5:
                        break
+               case 6:
+                       break
+               case 7:
+                       break
+               case 8:
+                       break
+               case 9:
+                       def event = Verify.getInt(0,1)
+                       if (event == 0) {
+                                       aeonKeyFobObject.setValue([name: "button", value: "pushed", deviceId: "aeonKeyFobID0", descriptionText: "",
+                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+                       } else {
+                                       aeonKeyFobObject.setValue([name: "button", value: "held", deviceId: "aeonKeyFobID0", descriptionText: "",
+                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+                       }
+                       break
        }
 }