Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index fb03c70..8194816 100644 (file)
@@ -645,6 +645,7 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "switch":
+                        
                        #Check which capability
                        variable = eventVarMap[eventList[i]]
                        if eventList[i] not in eventVarCounterMap.keys():
@@ -655,6 +656,8 @@ def ExtractEvents(extractedEvents):
                                eventVarCounterMap[eventList[i]] = eventVarCount + 1
                        capability = capabilityMap[variable[eventVarCount]]
                        #Write two events subsequently
+                        print("//////////////////////")
+                        print(capability)
                        if capability == "capability.switch":
                                event = open("eventSimulator/switchOnEvent.groovy", "r")
                        elif capability == "capability.switchLevel":
@@ -922,6 +925,8 @@ def ExtractEvents(extractedEvents):
                                event = open("eventSimulator/switchLevelEvent.groovy", "r")
                        elif capability == "capability.colorControl":
                                event = open("eventSimulator/colorLevelChangeEvent.groovy", "r")
+                        elif capability == "capability.switch":
+                                event = open("eventSimulator/switchLevelChangeEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()