Add support for values to subscribe function
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 1172b4e392a6d987c1ea764a0a74109fb268e9fd..63f0111c98a89a4afe35dd15929cf10013f7754a 100644 (file)
@@ -15,7 +15,6 @@ app2Subscribe = False
 # Mapping for event type and number of events
 # e.g., switch has 2 events: on and off
 eventTypeCounterMap =  {'lock': 2,
-                                               'unlock' : 1,
                                                'nfcTouch' : 1,
                                                'app' : 1,
                                                'button' : 2,
@@ -76,7 +75,6 @@ eventTypesMap =          {'alarm.both': 'alarm',
                                                'mode.away' : 'location',
                                                'mode.home' : 'location',
                                                'mode.night' : 'location',
-                                               'unlock' : 'lock',
                                                'lock.locked' : 'lock',
                                                'lock.unlocked' : 'lock',
                                                'motion.active' : 'motion',
@@ -214,7 +212,10 @@ def ExtractFunctions(F, appName):
                        #print "DEBUG: %s - %s" % (variable, Temp)
                        #print capabilityMap
                        #print "DEBUG: location variable: %s" % Temp    
-                       
+
+                        #This is a bogus event, just skip it...
+                        if Temp == "unlock":
+                                continue                        
                        #Translate and reduce through mapping
                        if Temp in eventTypesMap.keys():                
                                Temp = eventTypesMap[Temp]