Adding threeAxis event to the python script!
authoramiraj <amiraj.95@uci.edu>
Thu, 8 Aug 2019 19:10:42 +0000 (12:10 -0700)
committeramiraj <amiraj.95@uci.edu>
Thu, 8 Aug 2019 19:10:42 +0000 (12:10 -0700)
Extractor/ExtractorScript.py
eventSimulator/threeAxisChangeEvent.groovy [new file with mode: 0644]

index 8194816..1ad1029 100644 (file)
@@ -59,7 +59,8 @@ eventTypeCounterMap =  {'lock': 2,
                                                'temperature' : 2,
                                                'heatingSetpoint' : 1,
                                                'coolingSetpoint' : 1,
-                                               'thermostatSetpoint' : 1}
+                                               'thermostatSetpoint' : 1,
+                                                'threeAxis' : 1}
 
 # Mapping for specific event types
 eventTypesMap =           {'alarm.both': 'alarm',
@@ -996,6 +997,11 @@ def ExtractEvents(extractedEvents):
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
+                elif eventList[i] == "threeAxis":
+                        event = open("eventSimulator/threeAxisChangeEvent.groovy", "r")
+                        for line in event:
+                                extractedEvents.write(line)
+                        event.close()
                        
                ###TODO: Add more events later
                extractedEvents.write("\n\t\t\tbreak\n")
diff --git a/eventSimulator/threeAxisChangeEvent.groovy b/eventSimulator/threeAxisChangeEvent.groovy
new file mode 100644 (file)
index 0000000..2ce9b60
--- /dev/null
@@ -0,0 +1,2 @@
+                       threeAxisObject.setValue([name: "threeAxis", value: '{"x": 1, "y": 2, "z": 3}', deviceId: "threeAxisID0", descriptionText: "",
+                               displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])