From dd478f2cc3f2096c7deaa628f2f754228246c01c Mon Sep 17 00:00:00 2001 From: amiraj Date: Sat, 10 Aug 2019 14:59:34 -0700 Subject: [PATCH] Some minor changes! --- Extractor/ExtractorScript.py | 1 + Switch/Switches.groovy | 3 +++ eventSimulator/buttonHeldEvent.groovy | 11 ++++++++++- eventSimulator/buttonPushedEvent.groovy | 11 ++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) 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}']) -- 2.34.1