Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
authoramiraj <amiraj.95@uci.edu>
Thu, 8 Aug 2019 18:30:33 +0000 (11:30 -0700)
committeramiraj <amiraj.95@uci.edu>
Thu, 8 Aug 2019 18:30:33 +0000 (11:30 -0700)
13 files changed:
Extractor/ExtractorScript.py
Methods/runDaily.groovy [new file with mode: 0644]
Runner.py
appLists/global-state-variable-interaction/globalstatevariableAppList
eventSimulator/humidityHighMeasurementEvent.groovy [new file with mode: 0644]
eventSimulator/humidityLowMeasurementEvent.groovy [new file with mode: 0644]
eventSimulator/temperatureEvent.groovy [deleted file]
eventSimulator/temperatureHighEvent.groovy [new file with mode: 0644]
eventSimulator/temperatureHighMeasurementEvent.groovy [new file with mode: 0644]
eventSimulator/temperatureLowEvent.groovy [new file with mode: 0644]
eventSimulator/temperatureLowMeasurementEvent.groovy [new file with mode: 0644]
eventSimulator/temperatureMeasurementEvent.groovy [deleted file]
run.sh

index 502d422..8194816 100644 (file)
@@ -48,7 +48,7 @@ eventTypeCounterMap =  {'lock': 2,
                                                'energy' : 1,
                                                'power' : 2,
                                                'illuminance' : 1,
-                                               'humidity' : 1,
+                                               'humidity' : 2,
                                                'alarm' : 4,
                                                'contact' : 2,
                                                'status' : 3,
@@ -56,7 +56,7 @@ eventTypeCounterMap =  {'lock': 2,
                                                'trackDescription' : 1,
                                                'trackData' : 1,
                                                'mute' : 2,
-                                               'temperature' : 1,
+                                               'temperature' : 2,
                                                'heatingSetpoint' : 1,
                                                'coolingSetpoint' : 1,
                                                'thermostatSetpoint' : 1}
@@ -740,16 +740,6 @@ def ExtractEvents(extractedEvents):
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
-               elif eventList[i] == "acceleration.active":
-                       event = open("eventSimulator/accelerationDefaultActiveEvent.groovy", "r")
-                       for line in event:
-                               extractedEvents.write(line)
-                       event.close()
-               elif eventList[i] == "acceleration.inactive":
-                       event = open("eventSimulator/accelerationDefaultInactiveEvent.groovy", "r")
-                       for line in event:
-                               extractedEvents.write(line)
-                       event.close()
                elif eventList[i] == "sleeping":
                        #Write two events subsequently
                        event = open("eventSimulator/sleepSleepingEvent.groovy", "r")                   
@@ -833,7 +823,14 @@ def ExtractEvents(extractedEvents):
                                extractedEvents.write(line)
                        event.close()
                elif eventList[i] == "humidity":
-                       event = open("eventSimulator/humidityMeasurementEvent.groovy", "r")
+                       event = open("eventSimulator/humidityHighMeasurementEvent.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/humidityLowMeasurementEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
@@ -966,10 +963,21 @@ def ExtractEvents(extractedEvents):
                                eventVarCount = eventVarCounterMap[eventList[i]]
                                eventVarCounterMap[eventList[i]] = eventVarCount + 1
                        capability = capabilityMap[variable[eventVarCount]]
+                       #Write two events subsequently
+                       if capability == "capability.thermostat":
+                               event = open("eventSimulator/temperatureHighEvent.groovy", "r")
+                       elif capability == "capability.temperatureMeasurement":
+                               event = open("eventSimulator/temperatureHighMeasurementEvent.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)
                        if capability == "capability.thermostat":
-                               event = open("eventSimulator/temperatureEvent.groovy", "r")
+                               event = open("eventSimulator/temperatureLowEvent.groovy", "r")
                        elif capability == "capability.temperatureMeasurement":
-                               event = open("eventSimulator/temperatureMeasurementEvent.groovy", "r")
+                               event = open("eventSimulator/temperatureLowMeasurementEvent.groovy", "r")
                        for line in event:
                                extractedEvents.write(line)
                        event.close()
diff --git a/Methods/runDaily.groovy b/Methods/runDaily.groovy
new file mode 100644 (file)
index 0000000..eeca8c9
--- /dev/null
@@ -0,0 +1,4 @@
+/////////////////////////////////////////////////////////////////////
+def runDaily(String date, Closure methodToCall) {
+       methodToCall()
+}
index 9de06d9..ad8dff0 100644 (file)
--- a/Runner.py
+++ b/Runner.py
@@ -15,6 +15,7 @@ GlobalVariablesEachApp = open("GlobalVariables/"+"GlobalVariablesEachApp.groovy"
 setLocationMode = open("Methods/"+"setLocationMode.groovy", "r")
 subscribe = open("Methods/"+"subscribe.groovy", "r")
 runIn = open("Methods/"+"runIn.groovy", "r")
+runDaily = open("Methods/"+"runDaily.groovy", "r")
 unschedule = open("Methods/"+"unschedule.groovy", "r")
 sendNotificationToContacts = open("Methods/"+"sendNotificationToContacts.groovy", "r")
 sendSms = open("Methods/"+"sendSms.groovy", "r")
@@ -169,6 +170,8 @@ for line in subscribe:
        Out.write("\t"+line)
 for line in runIn:
        Out.write("\t"+line)
+for line in runDaily:
+       Out.write("\t"+line)
 for line in unschedule:
        Out.write("\t"+line)
 for line in sendNotificationToContacts:
@@ -220,6 +223,7 @@ GlobalVariablesEachApp = open("GlobalVariables/"+"GlobalVariablesEachApp.groovy"
 setLocationMode = open("Methods/"+"setLocationMode.groovy", "r")
 subscribe = open("Methods/"+"subscribe.groovy", "r")
 runIn = open("Methods/"+"runIn.groovy", "r")
+runDaily = open("Methods/"+"runDaily.groovy", "r")
 unschedule = open("Methods/"+"unschedule.groovy", "r")
 sendNotificationToContacts = open("Methods/"+"sendNotificationToContacts.groovy", "r")
 sendSms = open("Methods/"+"sendSms.groovy", "r")
@@ -275,6 +279,8 @@ for line in subscribe:
        Out.write("\t"+line)
 for line in runIn:
        Out.write("\t"+line)
+for line in runDaily:
+       Out.write("\t"+line)
 for line in unschedule:
        Out.write("\t"+line)
 for line in sendNotificationToContacts:
index 04c4d0a..56caae1 100644 (file)
@@ -31,7 +31,6 @@ speaker-weather-forecast.groovy
 sunrise-sunset.groovy
 switch-activates-home-phrase-or-mode.groovy
 switch-changes-mode.groovy
-talking-alarm-clock.groovy
 thermostat-mode-director.groovy
 vacation-lighting-director.groovy
 working-from-home.groovy
@@ -44,4 +43,6 @@ ecobeeResumeProg.groovy
 MonitorAndSetEcobeeHumidity.groovy
 SmartPresence.groovy
 Switches.groovy
-WorkingFromHome.groovy
\ No newline at end of file
+WorkingFromHome.groovy
+### The following is a very buggy app
+###talking-alarm-clock.groovy
diff --git a/eventSimulator/humidityHighMeasurementEvent.groovy b/eventSimulator/humidityHighMeasurementEvent.groovy
new file mode 100644 (file)
index 0000000..bcfe170
--- /dev/null
@@ -0,0 +1,2 @@
+                       humidityMeasurementObject.setValue([name: "humidity", value: "70"/*A number between 0 to 100 as a charge*/, deviceId: "humidityMeasurementID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/humidityLowMeasurementEvent.groovy b/eventSimulator/humidityLowMeasurementEvent.groovy
new file mode 100644 (file)
index 0000000..4692c5d
--- /dev/null
@@ -0,0 +1,2 @@
+                       humidityMeasurementObject.setValue([name: "humidity", value: "30"/*A number between 0 to 100 as a charge*/, deviceId: "humidityMeasurementID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/temperatureEvent.groovy b/eventSimulator/temperatureEvent.groovy
deleted file mode 100644 (file)
index d044685..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-                       thermostatObject.setValue([name: "temperature", value: "55", deviceId: "thermostatID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/temperatureHighEvent.groovy b/eventSimulator/temperatureHighEvent.groovy
new file mode 100644 (file)
index 0000000..d044685
--- /dev/null
@@ -0,0 +1,2 @@
+                       thermostatObject.setValue([name: "temperature", value: "55", deviceId: "thermostatID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/temperatureHighMeasurementEvent.groovy b/eventSimulator/temperatureHighMeasurementEvent.groovy
new file mode 100644 (file)
index 0000000..9e7db63
--- /dev/null
@@ -0,0 +1,2 @@
+                       temperatureMeasurementObject.setValue([name: "temperature", value: "55"/*A number between 0 to 100*/, deviceId: "temperatureMeasurementID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/temperatureLowEvent.groovy b/eventSimulator/temperatureLowEvent.groovy
new file mode 100644 (file)
index 0000000..cddbef7
--- /dev/null
@@ -0,0 +1,2 @@
+                       thermostatObject.setValue([name: "temperature", value: "45", deviceId: "thermostatID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/temperatureLowMeasurementEvent.groovy b/eventSimulator/temperatureLowMeasurementEvent.groovy
new file mode 100644 (file)
index 0000000..b8bce76
--- /dev/null
@@ -0,0 +1,2 @@
+                       temperatureMeasurementObject.setValue([name: "temperature", value: "45"/*A number between 0 to 100*/, deviceId: "temperatureMeasurementID0", descriptionText: "",
+                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/eventSimulator/temperatureMeasurementEvent.groovy b/eventSimulator/temperatureMeasurementEvent.groovy
deleted file mode 100644 (file)
index b8bce76..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-                       temperatureMeasurementObject.setValue([name: "temperature", value: "45"/*A number between 0 to 100*/, deviceId: "temperatureMeasurementID0", descriptionText: "",
-                                       displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
diff --git a/run.sh b/run.sh
index 7a11ade..8c18873 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -1,7 +1,8 @@
 #!/bin/bash
 
 # Device conflict
-python ModelCheck.py ../jpf-core/ ../logs/acfanheaterSwitches/ ../smartapps/ appLists/device-interaction/acfanheaterSwitchesAppList appLists/device-interaction/acfanheaterSwitchesAppList2
+#python ModelCheck.py ../jpf-core/ ../logs/valves/ ../smartapps/ appLists/device-interaction/valvesAppList appLists/device-interaction/valvesAppList2
+#python ModelCheck.py ../jpf-core/ ../logs/acfanheaterSwitches/ ../smartapps/ appLists/device-interaction/acfanheaterSwitchesAppList appLists/device-interaction/acfanheaterSwitchesAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/cameraSwitches/ ../smartapps/ appLists/device-interaction/cameraSwitchesAppList appLists/device-interaction/cameraSwitchesAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/ventfanSwitches/ ../smartapps/ appLists/device-interaction/ventfanSwitchesAppList appLists/device-interaction/ventfanSwitchesAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/speeches/ ../smartapps/ appLists/device-interaction/speechesAppList appLists/device-interaction/speechesAppList2
@@ -11,7 +12,7 @@ python ModelCheck.py ../jpf-core/ ../logs/acfanheaterSwitches/ ../smartapps/ app
 #python ModelCheck.py ../jpf-core/ ../logs/alarms/ ../smartapps/ appLists/device-interaction/alarmsAppList appLists/device-interaction/alarmsAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/locks/ ../smartapps/ appLists/device-interaction/locksAppList appLists/device-interaction/locksAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/musicPlayers/ ../smartapps/ appLists/device-interaction/musicPlayersAppList
-#python ModelCheck.py ../jpf-core/ ../logs/relaySwitch/ ../smartapps/ appLists/device-interaction/relaySwitchesAppList
+#python ModelCheck.py ../jpf-core/ ../logs/relaySwitches/ ../smartapps/ appLists/device-interaction/relaySwitchesAppList appLists/device-interaction/relaySwitchesAppList2
 #python ModelCheck.py ../jpf-core/ ../logs/cameras/ ../smartapps/ appLists/device-interaction/camerasAppList
 
 # Physical conflict
@@ -19,3 +20,6 @@ python ModelCheck.py ../jpf-core/ ../logs/acfanheaterSwitches/ ../smartapps/ app
 #python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/motionsensorAppList appLists/physical-interaction/motionAppList
 #python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/illuminancesensorAppList appLists/physical-interaction/lightAppList
 #python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/watersensorAppList appLists/physical-interaction/watervalveAppList
+
+# Global variable conflict
+python ModelCheck.py ../jpf-core/ ../logs/globalStateVariables/ ../smartapps/ appLists/global-state-variable-interaction/globalstatevariableAppList appLists/global-state-variable-interaction/globalstatevariableAppList2