extractedEvents.write("\t\t" + line)
event.close()
extractedEvents.write("\t\t\t}\n")
+ elif eventMap[i] == "acceleration":
+ #Write two events subsequently
+ extractedEvents.write("\t\t\tdef event = Verify.getInt(0,1)\n")
+ extractedEvents.write("\t\t\tif (event == 0) {\n")
+ event = open("eventSimulator/accelerationActiveEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write("\t\t" + line)
+ event.close()
+ extractedEvents.write("\t\t\t} else {\n")
+ event = open("eventSimulator/accelerationInactiveEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write("\t\t" + line)
+ event.close()
+ extractedEvents.write("\t\t\t}\n")
+ elif eventMap[i] == "beacon":
+ #Write two events subsequently
+ extractedEvents.write("\t\t\tdef event = Verify.getInt(0,1)\n")
+ extractedEvents.write("\t\t\tif (event == 0) {\n")
+ event = open("eventSimulator/beaconPresenceEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write("\t\t" + line)
+ event.close()
+ extractedEvents.write("\t\t\t} else {\n")
+ event = open("eventSimulator/beaconLeftEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write("\t\t" + line)
+ event.close()
+ extractedEvents.write("\t\t\t}\n")
+ elif eventMap[i] == "color":
+ event = open("eventSimulator/colorChangeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "hue":
+ event = open("eventSimulator/hueChangeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
+ elif eventMap[i] == "saturation":
+ event = open("eventSimulator/saturationChangeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
###TODO: Add more events later
extractedEvents.write("\t\t\tbreak\n")
--- /dev/null
+ accelerationSensorObject.setValue([name: "acceleration", value: "active", deviceId: "accelerationSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ accelerationSensorObject.setValue([name: "acceleration", value: "inactive", deviceId: "accelerationSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ beaconSensorObject.setValue([name: "beacon", value: "not present", deviceId: "beaconSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ beaconSensorObject.setValue([name: "beacon", value: "present", deviceId: "beaconeSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- smokeDetectorObject.setValue([name: "carbonMonoxide", value: "clear", deviceId: "smokeDetectorID0", descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
+ carbonMonoxideDetectorObject.setValue([name: "carbonMonoxide", value: "clear", deviceId: "carbonMonoxideDetectorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- smokeDetectorObject.setValue([name: "carbonMonoxide", value: "detected", deviceId: "smokeDetectorID0", descriptionText: "",
+ carbonMonoxideDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "carbonMonoxideDetectorID0", descriptionText: "",
displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
- smokeDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "smokeDetectorID0", descriptionText: "",
+ carbonMonoxideDetectorObject.setValue([name: "carbonMonoxide", value: "tested", deviceId: "carbonMonoxideDetectorID0", descriptionText: "",
displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ colorControlObject.setValue([name: "color", value: "red", deviceId: "colorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ colorControlObject.setValue([name: "hue", value: "50", deviceId: "colorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])
--- /dev/null
+ colorControlObject.setValue([name: "saturation", value: "50", deviceId: "colorControlID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: [info: "info"]])