Adding remaining devices!
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 8a888fc..1f01568 100644 (file)
@@ -60,7 +60,21 @@ eventTypeCounterMap =  {'lock': 2,
                                                'heatingSetpoint' : 1,
                                                'coolingSetpoint' : 1,
                                                'thermostatSetpoint' : 1,
-                                               'threeAxis' : 1}
+                                               'threeAxis' : 1,
+                                               'carbonDioxide' : 1,
+                                               'consumableStatus' : 1,
+                                               'pH' : 1,
+                                               'pressure': 1,
+                                               'shock': 1,
+                                               'lqi': 1,
+                                               'rssi': 1,
+                                               'sound': 1,
+                                               'soundPressureLevel' : 1,
+                                               'tamper' : 1,
+                                               'ultravioletIndex': 1,
+                                               'voltage': 1,
+                                               'windowShade': 1,
+                                               'touched': 1}
 
 # Mapping for specific event types
 eventTypesMap =           {'alarm.both': 'alarm',
@@ -1015,6 +1029,71 @@ def ExtractEvents(extractedEvents):
                         for line in event:
                                 extractedEvents.write(line)
                         event.close()
+               elif eventList[i] == "carbonDioxide":
+                       event = open("eventSimulator/carbonDioxideEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "consumableStatus":
+                       event = open("eventSimulator/consumableStatusEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "pH":
+                       event = open("eventSimulator/pHEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "pressure":
+                       event = open("eventSimulator/pressureEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "shock":
+                       event = open("eventSimulator/shockEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "lqi":
+                       event = open("eventSimulator/lqiEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "rssi":
+                       event = open("eventSimulator/rssiEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "sound":
+                       event = open("eventSimulator/soundEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "soundPressureLevel":
+                       event = open("eventSimulator/soundPressureLevelEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "tamper":
+                       event = open("eventSimulator/tamperEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "voltage":
+                       event = open("eventSimulator/voltageEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "ultravioletIndex":
+                       event = open("eventSimulator/ultravioletIndexEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
+               elif eventList[i] == "windowShade":
+                       event = open("eventSimulator/windowShadeEvent.groovy", "r")
+                       for line in event:
+                               extractedEvents.write(line)
+                       event.close()
                        
                ###TODO: Add more events later
                extractedEvents.write("\n\t\t\tbreak\n")