Adding missing methods etc.
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 9437601..3a87c23 100644 (file)
@@ -39,14 +39,14 @@ eventTypeCounterMap =  {'lock': 2,
                                                'sunriseTime' : 1,
                                                'acceleration' : 2,
                                                'sleeping' : 2,
-                                               'goal' : 1,
-                                               'steps' : 1,
+                                               'goal' : 2,
+                                               'steps' : 2,
                                                'color' : 1,
                                                'colorTemperature' : 1,
                                                'hue' : 1,
                                                'saturation' : 1,
                                                'energy' : 1,
-                                               'power' : 1,
+                                               'power' : 2,
                                                'illuminance' : 1,
                                                'humidity' : 1,
                                                'alarm' : 4,
@@ -761,12 +761,28 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "goal":
-                       event = open("eventSimulator/stepGoalEvent.groovy", "r")
+                       #Write two events subsequently
+                       event = open("eventSimulator/stepGoalHighEvent.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/stepGoalLowEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "steps":
-                       event = open("eventSimulator/stepStepsEvent.groovy", "r")
+                       #Write two events subsequently
+                       event = open("eventSimulator/stepStepsHighEvent.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/stepStepsLowEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()