From: amiraj Date: Sat, 10 Aug 2019 21:59:34 +0000 (-0700) Subject: Some minor changes! X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=dd478f2cc3f2096c7deaa628f2f754228246c01c;hp=de9342b03393d0df0ee9105f0233deb4efddaea4 Some minor changes! --- diff --git a/Extractor/ExtractorScript.py b/Extractor/ExtractorScript.py index a5d46c8..2c96590 100644 --- a/Extractor/ExtractorScript.py +++ b/Extractor/ExtractorScript.py @@ -461,6 +461,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: diff --git a/Switch/Switches.groovy b/Switch/Switches.groovy index c27440d..152096d 100644 --- a/Switch/Switches.groovy +++ b/Switch/Switches.groovy @@ -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) } diff --git a/eventSimulator/buttonHeldEvent.groovy b/eventSimulator/buttonHeldEvent.groovy index 76209df..8a8f90d 100644 --- a/eventSimulator/buttonHeldEvent.groovy +++ b/eventSimulator/buttonHeldEvent.groovy @@ -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}']) diff --git a/eventSimulator/buttonPushedEvent.groovy b/eventSimulator/buttonPushedEvent.groovy index 0792d4f..d6013e1 100644 --- a/eventSimulator/buttonPushedEvent.groovy +++ b/eventSimulator/buttonPushedEvent.groovy @@ -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}'])