Fixing the previous commit bugs! Adding required classes + required methods
[smartthings-infrastructure.git] / eventSimulator / eventSimulator.groovy
index b0cd6dc971f5ba1ec69911f6e93835c25a031cb8..ed622393e673656686ca2d9aa219f9fa232882dc 100644 (file)
 while(true) {
-       def eventNumber = Verify.getInt(0,53)
+       def eventNumber = Verify.getInt(0,9)
        switch(eventNumber) {
                case 0:
-                       break
-               case 1:
-                       break
-               case 2:
-                       break
-               case 3:
                        def event = Verify.getInt(0,2)
                        if (event == 0) {
-                                       smokeDetectorObject.setValue([name: "smoke", value: "clear", deviceId: "smokeDetectorID0", descriptionText: "",
+                                       locationObject.setValue([name: "Location", value: "home", deviceId: "locationID0", descriptionText: "",
                                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        } else if (event == 1) {
-                                       smokeDetectorObject.setValue([name: "smoke", value: "detected", deviceId: "smokeDetectorID0", descriptionText: "",
+                                       locationObject.setValue([name: "Location", value: "away", deviceId: "locationID0", descriptionText: "",
                                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        } else {
-                                       smokeDetectorObject.setValue([name: "smoke", value: "tested", deviceId: "smokeDetectorID0", 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:
+                       break
+               case 3:
+                       break
                case 4:
-                       def event = Verify.getInt(0,2)
-                       if (event == 0) {
-                                       smokeDetectorObject.setValue([name: "carbonMonoxide", value: "clear", deviceId: "smokeDetectorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else if (event == 1) {
-                                       smokeDetectorObject.setValue([name: "carbonMonoxide", value: "detected", deviceId: "smokeDetectorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else {
-                                       smokeDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "smokeDetectorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       }
                        break
                case 5:
                        break
                case 6:
                        break
                case 7:
-                       lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        break
                case 8:
-                       def event = Verify.getInt(0,1)
-                       if (event == 0) {
-                                       accelerationSensorObject.setValue([name: "acceleration", value: "active", deviceId: "accelerationSensorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else {
-                                       accelerationSensorObject.setValue([name: "acceleration", value: "inactive", deviceId: "accelerationSensorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       }
                        break
                case 9:
                        def event = Verify.getInt(0,1)
                        if (event == 0) {
-                                       motionSensorObject.setValue([name: "motion", value: "active", deviceId: "motionSensorID0", descriptionText: "",
+                                       aeonKeyFobObject.setValue([name: "button", value: "pushed", deviceId: "aeonKeyFobID0", descriptionText: "",
                                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        } else {
-                                       motionSensorObject.setValue([name: "motion", value: "inactive", deviceId: "motionSensorID0", descriptionText: "",
+                                       aeonKeyFobObject.setValue([name: "button", value: "held", deviceId: "aeonKeyFobID0", descriptionText: "",
                                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        }
                        break
-               case 10:
-                       def event = Verify.getInt(0,1)
-                       if (event == 0) {
-                                       presenceSensorObject.setValue([name: "presence", value: "present", deviceId: "presenceSensorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"1","dni":"mobile0"}'])
-                       } else {
-                                       presenceSensorObject.setValue([name: "presence", value: "not present", deviceId: "presenceSensorID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"0","dni":"mobile0"}'])
-                       }
-                       break
-               case 11:
-                       def event = Verify.getInt(0,1)
-                       if (event == 0) {
-                                       switchObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else {
-                                       switchObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       }
-                       break
-               case 12:
-                       break
-               case 13:
-                       smokeDetectorObject.setValue([name: "battery", value: "5", deviceId: "smokeDetectorID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       break
-               case 14:
-                       break
-               case 15:
-                       break
-               case 16:
-                       break
-               case 17:
-                       break
-               case 18:
-                       break
-               case 19:
-                       def event = Verify.getInt(0,4)
-                       if (event == 0) {
-                                       thermostatObject.setValue([name: "thermostatMode", value: "auto", deviceId: "thermostatID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else if (event == 1) {
-                                       thermostatObject.setValue([name: "thermostatMode", value: "cool", deviceId: "thermostatID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else if (event == 2) {
-                                       thermostatObject.setValue([name: "thermostatMode", value: "emergencyHeat", deviceId: "thermostatID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else if (event == 3) {
-                                       thermostatObject.setValue([name: "thermostatMode", value: "heat", deviceId: "thermostatID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       } else {
-                                       thermostatObject.setValue([name: "thermostatMode", value: "off", deviceId: "thermostatID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       }
-                       break
-               case 20:
-                       break
-               case 21:
-                       break
-               case 22:
-                       break
-               case 23:
-                       break
-               case 24:
-                       break
-               case 25:
-                       break
-               case 26:
-                       break
-               case 27:
-                       break
-               case 28:
-                       break
-               case 29:
-                       break
-               case 30:
-                       break
-               case 31:
-                       break
-               case 32:
-                       break
-               case 33:
-                       break
-               case 34:
-                       break
-               case 35:
-                       break
-               case 36:
-                       break
-               case 37:
-                       break
-               case 38:
-                       break
-               case 39:
-                       break
-               case 40:
-                       break
-               case 41:
-                       break
-               case 42:
-                       break
-               case 43:
-                       break
-               case 44:
-                       break
-               case 45:
-                       break
-               case 46:
-                       break
-               case 47:
-                       break
-               case 48:
-                       break
-               case 49:
-                       break
-               case 50:
-                       break
-               case 51:
-                       break
-               case 52:
-                       def event = Verify.getInt(0,2)
-                       if (event == 0) {
-                                       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 {
-                                       locationObject.setValue([name: "Location", value: "night", deviceId: "locationID0", descriptionText: "",
-                                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       }
-                       break
-               case 53:
-                       appObject.setValue([name: "Touched", value: "touched", deviceId: "touchedSensorID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
-                       break
        }
 }