Adding event for Power as variation is needed in power values.
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 1172b4e..cf4b9de 100644 (file)
@@ -795,7 +795,15 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "power":
-                       event = open("eventSimulator/powerMeterEvent.groovy", "r")
+                       #Write two events subsequently
+                       event = open("eventSimulator/powerMeterHighPowerEvent.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/powerMeterLowPowerEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()