Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index f972b70..8a888fc 100644 (file)
@@ -47,7 +47,7 @@ eventTypeCounterMap =  {'lock': 2,
                                                'saturation' : 1,
                                                'energy' : 1,
                                                'power' : 2,
-                                               'illuminance' : 1,
+                                               'illuminance' : 2,
                                                'humidity' : 2,
                                                'alarm' : 4,
                                                'contact' : 2,
@@ -60,7 +60,7 @@ eventTypeCounterMap =  {'lock': 2,
                                                'heatingSetpoint' : 1,
                                                'coolingSetpoint' : 1,
                                                'thermostatSetpoint' : 1,
-                                                'threeAxis' : 1}
+                                               'threeAxis' : 1}
 
 # Mapping for specific event types
 eventTypesMap =           {'alarm.both': 'alarm',
@@ -825,7 +825,14 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "illuminance":
-                       event = open("eventSimulator/illuminanceMeasurementEvent.groovy", "r")
+                       event = open("eventSimulator/illuminanceMeasurementLowEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+                       extractedEvents.write("\n\t\t\tbreak\n")
+                       counter = counter + 1
+                       extractedEvents.write("\t\tcase %d:\n" % counter)
+                       event = open("eventSimulator/illuminanceMeasurementHighEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()