Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
authoramiraj <amiraj.95@uci.edu>
Sat, 10 Aug 2019 22:00:58 +0000 (15:00 -0700)
committeramiraj <amiraj.95@uci.edu>
Sat, 10 Aug 2019 22:00:58 +0000 (15:00 -0700)
Extractor/ExtractorScript.py
Switch/Switches.groovy
eventSimulator/buttonHeldEvent.groovy
eventSimulator/buttonPushedEvent.groovy

index 1643c43..f972b70 100644 (file)
@@ -462,6 +462,7 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "motion":
+                        print("HERE????")
                        #Write two events subsequently
                        event = open("eventSimulator/motionActiveEvent.groovy", "r")                    
                        for line in event:
index c27440d..152096d 100644 (file)
@@ -51,6 +51,9 @@ public class Switches {
        def each(Closure Input) {
                switches.each(Input)
        }
+       def eachWithIndex(Closure Input) {
+               switches.eachWithIndex(Input)
+       }
        def find(Closure Input) {
                switches.find(Input)
        }
index 76209df..8a8f90d 100644 (file)
@@ -1,2 +1,11 @@
                        buttonObject.setValue([name: "button", value: "held", deviceId: "switchID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 3}'])
+                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 1}'])
+
+                       buttonObject.setValue([name: "button", value: "held", deviceId: "switchID0", descriptionText: "",
+                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 2}'])
+
+                       buttonObject.setValue([name: "button", value: "held", deviceId: "switchID0", descriptionText: "",
+                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 3}'])                   
+
+                       buttonObject.setValue([name: "button", value: "held", deviceId: "switchID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 4}'])
index 0792d4f..d6013e1 100644 (file)
@@ -1,2 +1,11 @@
+                        buttonObject.setValue([name: "button", value: "pushed", deviceId: "switchID0", descriptionText: "",
+                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 1}'])
+
+                        buttonObject.setValue([name: "button", value: "pushed", deviceId: "switchID0", descriptionText: "",
+                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 2}'])
+
+                        buttonObject.setValue([name: "button", value: "pushed", deviceId: "switchID0", descriptionText: "",
+                                        displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 3}'])
+
                        buttonObject.setValue([name: "button", value: "pushed", deviceId: "switchID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 3}'])
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"buttonNumber": 4}'])