Updating global variable app list.
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 1ad102977466a6eb9c3ba7dc72c4ab22348eb2be..a5d46c899934a97e650c73d5a28ecd2f692dfdd3 100644 (file)
@@ -72,6 +72,7 @@ eventTypesMap =          {'alarm.both': 'alarm',
                                                'tamper.tampered' : 'contact',
                                                'doorState.open' : 'doorState',
                                                'doorState.closed' : 'doorState',
+                                               'position' : 'location',
                                                'mode' : 'location',
                                                'mode.away' : 'location',
                                                'mode.home' : 'location',
@@ -334,8 +335,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 +651,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():