From: amiraj Date: Wed, 7 Aug 2019 02:05:48 +0000 (-0700) Subject: Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=33b28ef5e367fbf98724f874c6c7616c20d831d7;hp=895bb616c6c2a7ae845b67c2a30dadc646cad9b6 Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure --- diff --git a/Extractor/ExtractorScript.py b/Extractor/ExtractorScript.py index 5d92fc4..cf4b9de 100644 --- a/Extractor/ExtractorScript.py +++ b/Extractor/ExtractorScript.py @@ -76,6 +76,7 @@ eventTypesMap = {'alarm.both': 'alarm', 'mode.away' : 'location', 'mode.home' : 'location', 'mode.night' : 'location', + 'unlock' : 'lock', 'lock.locked' : 'lock', 'lock.unlocked' : 'lock', 'motion.active' : 'motion', @@ -331,6 +332,7 @@ def ExtractEvents(extractedEvents): #print "DEBUG: App1: %d" % indexApp1 #print "DEBUG: App2: %d" % indexApp2 #print "DEBUG: eventList: %d" % len(eventList) + #print eventList isApp1 = True while counter < numOfActualEvents: # Interleave events from App1 and App2 @@ -359,9 +361,6 @@ def ExtractEvents(extractedEvents): for line in event: extractedEvents.write(line) event.close() - elif eventList[i] == "unlock": - #Don't do anything for this case - counter = counter - 1 elif eventList[i] == "nfcTouch": event = open("eventSimulator/nfcTouchEvent.groovy", "r") for line in event: @@ -796,7 +795,15 @@ def ExtractEvents(extractedEvents): extractedEvents.write(line) event.close() elif eventList[i] == "power": - event = open("eventSimulator/powerMeterEvent.groovy", "r") + #Write two events subsequently + event = open("eventSimulator/powerMeterHighPowerEvent.groovy", "r") + for line in event: + extractedEvents.write(line) + event.close() + extractedEvents.write("\n\t\t\tbreak\n") + counter = counter + 1 + extractedEvents.write("\t\tcase %d:\n" % counter) + event = open("eventSimulator/powerMeterLowPowerEvent.groovy", "r") for line in event: extractedEvents.write(line) event.close() diff --git a/GlobalVariables/GlobalVariablesEachApp.groovy b/GlobalVariables/GlobalVariablesEachApp.groovy index ae8b936..ba78f98 100644 --- a/GlobalVariables/GlobalVariablesEachApp.groovy +++ b/GlobalVariables/GlobalVariablesEachApp.groovy @@ -3,11 +3,11 @@ def state = [home:[],away:[],night:[]] //Create a global logger object for methods def log = new Logger() //Create a global variable for Functions in Subscribe method -def functionList = [] +def functionList = new ArrayList(20) //Create a global variable for Objects in Subscribe method -def objectList = [] +def objectList = new ArrayList(20) //Create a global variable for Events in Subscribe method -def eventList = [] +def eventList = new ArrayList(20) //Create a global variable for settings def settings //Zip code diff --git a/SpeechSynthesis/SpeechSynthesis.groovy b/SpeechSynthesis/SpeechSynthesis.groovy index fb91378..1f25d79 100644 --- a/SpeechSynthesis/SpeechSynthesis.groovy +++ b/SpeechSynthesis/SpeechSynthesis.groovy @@ -29,9 +29,9 @@ public class SpeechSynthesis { println("Speech synthesis with id:$id, SPEAKING:\"$message\"!") // As a conflict variable if (oneUser) { - oneUser = false + this.oneUser = false } else { - oneUser = true + this.oneUser = true } } } diff --git a/SpeechSynthesis/SpeechSynthesises.groovy b/SpeechSynthesis/SpeechSynthesises.groovy index 69601c4..876e48d 100644 --- a/SpeechSynthesis/SpeechSynthesises.groovy +++ b/SpeechSynthesis/SpeechSynthesises.groovy @@ -61,9 +61,9 @@ public class SpeechSynthesises { speechSynthesises[0].speak(message) // As a conflict variable if (oneUser) { - oneUser = false + this.oneUser = false } else { - oneUser = true + this.oneUser = true } } diff --git a/eventSimulator/powerMeterHighPowerEvent.groovy b/eventSimulator/powerMeterHighPowerEvent.groovy new file mode 100644 index 0000000..2fdf6dd --- /dev/null +++ b/eventSimulator/powerMeterHighPowerEvent.groovy @@ -0,0 +1,2 @@ + powerMeterObject.setValue([name: "power", value: "70"/*A number between 0 to 100 as a charge*/, deviceId: "powerMeterID0", descriptionText: "", + displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) diff --git a/eventSimulator/powerMeterLowPowerEvent.groovy b/eventSimulator/powerMeterLowPowerEvent.groovy new file mode 100644 index 0000000..58f7c58 --- /dev/null +++ b/eventSimulator/powerMeterLowPowerEvent.groovy @@ -0,0 +1,2 @@ + powerMeterObject.setValue([name: "power", value: "30"/*A number between 0 to 100 as a charge*/, deviceId: "powerMeterID0", descriptionText: "", + displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])