X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=blobdiff_plain;f=eventSimulator%2FeventSimulator.groovy;h=ed622393e673656686ca2d9aa219f9fa232882dc;hp=82cbd6a68cf3d6953b3b014d25e8605dca2c69ad;hb=7d426cdadcd09717f1c33b740731a4ddb29adb06;hpb=a97167cd66b70c9fa13d31ed411036713f386498 diff --git a/eventSimulator/eventSimulator.groovy b/eventSimulator/eventSimulator.groovy index 82cbd6a..ed62239 100644 --- a/eventSimulator/eventSimulator.groovy +++ b/eventSimulator/eventSimulator.groovy @@ -1,30 +1,45 @@ while(true) { - def eventNumber = Verify.getInt(0,4) + def eventNumber = Verify.getInt(0,9) switch(eventNumber) { case 0: - lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "", - displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) + 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 1: - lockObject.setValue([name: "unlock", value: "unlocked ", deviceId: "lockID0", descriptionText: "", + contactObject.setValue([name: "contact.open", value: "open", deviceId: "contactSensorID0", descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) break case 2: - contactObject.setValue([name: "contact.open", value: "open", deviceId: "contactSensorID0", descriptionText: "", - displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) break case 3: - contactObject.setValue([name: "contact.closed", value: "closed", deviceId: "contactSensorID0", 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) { - presenceSensorObject.setValue([name: "presence", value: "present", deviceId: "presenceSensorID0", descriptionText: "", - displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"1","dni":"mobile0"}']) + aeonKeyFobObject.setValue([name: "button", value: "pushed", deviceId: "aeonKeyFobID0", descriptionText: "", + displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } else { - presenceSensorObject.setValue([name: "presence", value: "not present", deviceId: "presenceSensorID0", descriptionText: "", - displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"presence":"0","dni":"mobile0"}']) + aeonKeyFobObject.setValue([name: "button", value: "held", deviceId: "aeonKeyFobID0", descriptionText: "", + displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } break }