Fixing a bug: unlock is supposed to be recognized as lock event.
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 5d92fc4dd1e315263098affa8265f16f695e4bd1..1172b4e392a6d987c1ea764a0a74109fb268e9fd 100644 (file)
@@ -76,6 +76,7 @@ eventTypesMap =          {'alarm.both': 'alarm',
                                                'mode.away' : 'location',
                                                'mode.home' : 'location',
                                                'mode.night' : 'location',
+                                               'unlock' : 'lock',
                                                'lock.locked' : 'lock',
                                                'lock.unlocked' : 'lock',
                                                'motion.active' : 'motion',
@@ -331,6 +332,7 @@ def ExtractEvents(extractedEvents):
        #print "DEBUG: App1: %d" % indexApp1
        #print "DEBUG: App2: %d" % indexApp2
        #print "DEBUG: eventList: %d" % len(eventList)
+       #print eventList
        isApp1 = True
        while counter < numOfActualEvents:
                # Interleave events from App1 and App2
@@ -359,9 +361,6 @@ def ExtractEvents(extractedEvents):
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
-               elif eventList[i] == "unlock":
-                       #Don't do anything for this case
-                       counter = counter - 1
                elif eventList[i] == "nfcTouch":
                        event = open("eventSimulator/nfcTouchEvent.groovy", "r")
                        for line in event: