Fixing a bug in ExtractorScript.py: missing a check if there is no event for App1.
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 1ad102977466a6eb9c3ba7dc72c4ab22348eb2be..53ba8b2f769dda648223d937591ab900749f05d3 100644 (file)
@@ -334,8 +334,12 @@ def ExtractEvents(extractedEvents):
        #print "DEBUG: App1: %d" % indexApp1
        #print "DEBUG: App2: %d" % indexApp2
        #print "DEBUG: eventList: %d" % len(eventList)
+       #print eventAppList
        #print eventList
-       isApp1 = True
+       if indexApp2Start > 0:
+               isApp1 = True
+       else:
+               isApp1 = False
        while counter < numOfActualEvents:
                # Interleave events from App1 and App2
                if isApp1 is True:
@@ -646,7 +650,6 @@ 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():