Infrastructure compatible for all groups instead of switches.
[smartthings-infrastructure.git] / Runner.py
index d72844dbe2d2be08adace65a80fcfab232280238..087dd3e569432a92664675658aa9870886028c51 100644 (file)
--- a/Runner.py
+++ b/Runner.py
@@ -29,6 +29,10 @@ runEvery15Minutes = open("Methods/"+"runEvery15Minutes.groovy", "r")
 timeToday = open("Methods/"+"timeToday.groovy", "r")
 sendNotification = open("Methods/"+"sendNotification.groovy", "r")
 canSchedule = open("Methods/"+"canSchedule.groovy", "r")
+createAccessToken = open("Methods/"+"createAccessToken.groovy", "r")
+runOnce = open("Methods/"+"runOnce.groovy", "r")
+parseJson = open("Methods/"+"parseJson.groovy", "r")
+unsubscribe = open("Methods/"+"unsubscribe.groovy", "r")
 App1 = open("Extractor/"+"App1/App1.groovy", "r")
 extractedObjectsApp1 = open("Extractor/"+"App1/extractedObjectsApp1.groovy", "r")
 extractedObjectsConstructorApp1 = open("Extractor/"+"App1/extractedObjectsConstructorApp1.groovy", "r")
@@ -108,8 +112,13 @@ Out.write("import Valve.Valve\n")
 Out.write("import Valve.Valves\n")
 Out.write("import MobilePresence.MobilePresence\n")
 Out.write("import MobilePresence.MobilePresences\n")
+Out.write("import ColorTemperature.ColorTemperature\n")
+Out.write("import ColorTemperature.ColorTemperatures\n")
+Out.write("import Button.Button\n")
+Out.write("import Button.Buttons\n")
+Out.write("import ThreeAxis.ThreeAxis\n")
+Out.write("import ThreeAxis.ThreeAxises\n")
 Out.write("import Event.Event\n")
-Out.write("import AtomicState.AtomicState\n")
 Out.write("import Timer.SimulatedTimer\n")
 Out.write("\n")
 Out.write("//JPF's Verify API\n")
@@ -128,7 +137,6 @@ Out.write("class App1 {\n")
 Out.write("\tdef reference\n")
 Out.write("\tdef location\n")
 Out.write("\tdef app\n")
-Out.write("\tdef atomicState\n")
 Out.write("\n")
 Out.write("\t//Extracted objects for App1\n")
 for line in extractedObjectsApp1:
@@ -142,7 +150,6 @@ Out.write("\tApp1(Object obj) {\n")
 Out.write("\t\treference = obj\n")
 Out.write("\t\tlocation = obj.locationObject\n")
 Out.write("\t\tapp = obj.appObject\n")
-Out.write("\t\tatomicState = obj.atomicState\n")
 for line in extractedObjectsConstructorApp1:
        Out.write("\t\t"+line)
 Out.write("\t}\n")
@@ -183,6 +190,14 @@ for line in sendNotification:
        Out.write("\t"+line)
 for line in canSchedule:
        Out.write("\t"+line)
+for line in createAccessToken:
+       Out.write("\t"+line)
+for line in runOnce:
+       Out.write("\t"+line)
+for line in parseJson:
+       Out.write("\t"+line)
+for line in unsubscribe:
+       Out.write("\t"+line)
 Out.write("\n")
 Start = 0
 for line in App1:
@@ -214,6 +229,10 @@ runEvery15Minutes = open("Methods/"+"runEvery15Minutes.groovy", "r")
 timeToday = open("Methods/"+"timeToday.groovy", "r")
 sendNotification = open("Methods/"+"sendNotification.groovy", "r")
 canSchedule = open("Methods/"+"canSchedule.groovy", "r")
+createAccessToken = open("Methods/"+"createAccessToken.groovy", "r")
+runOnce = open("Methods/"+"runOnce.groovy", "r")
+parseJson = open("Methods/"+"parseJson.groovy", "r")
+unsubscribe = open("Methods/"+"unsubscribe.groovy", "r")
 App2 = open("Extractor/"+"App2/App2.groovy", "r")
 extractedObjectsApp2 = open("Extractor/"+"App2/extractedObjectsApp2.groovy", "r")
 extractedObjectsConstructorApp2 = open("Extractor/"+"App2/extractedObjectsConstructorApp2.groovy", "r")
@@ -224,7 +243,6 @@ Out.write("class App2 {\n")
 Out.write("\tdef reference\n")
 Out.write("\tdef location\n")
 Out.write("\tdef app\n")
-Out.write("\tdef atomicState\n")
 Out.write("\n")
 Out.write("\t//Extracted objects for App2\n")
 for line in extractedObjectsApp2:
@@ -238,7 +256,6 @@ Out.write("\tApp2(Object obj) {\n")
 Out.write("\t\treference = obj\n")
 Out.write("\t\tlocation = obj.locationObject\n")
 Out.write("\t\tapp = obj.appObject\n")
-Out.write("\t\tatomicState = obj.atomicState\n")
 for line in extractedObjectsConstructorApp2:
        Out.write("\t\t"+line)
 Out.write("\t}\n")
@@ -279,6 +296,14 @@ for line in sendNotification:
        Out.write("\t"+line)
 for line in canSchedule:
        Out.write("\t"+line)
+for line in createAccessToken:
+       Out.write("\t"+line)
+for line in runOnce:
+       Out.write("\t"+line)
+for line in parseJson:
+       Out.write("\t"+line)
+for line in unsubscribe:
+       Out.write("\t"+line)
 Out.write("\n")
 Start = 0
 for line in App2:
@@ -290,22 +315,22 @@ Out.write("}\n")
 Out.write("\n")
 Out.write("@Field def app1\n")
 Out.write("@Field def app2\n")
-Out.write("def initOrder = Verify.getBoolean()\n")
-Out.write("if (initOrder) {\n")
+Out.write("//def initOrder = Verify.getBoolean()\n")
+Out.write("//if (initOrder) {\n")
 Out.write("\tapp1 = new App1(this)\n")
 Out.write("\tapp2 = new App2(this)\n")
-Out.write("} else {\n")
-Out.write("\tapp2 = new App2(this)\n")
-Out.write("\tapp1 = new App1(this)\n")
-Out.write("}\n\n")
-Out.write("def installOrder = Verify.getBoolean()\n")
-Out.write("if (installOrder) {\n")
+Out.write("//} else {\n")
+Out.write("\t//app2 = new App2(this)\n")
+Out.write("\t//app1 = new App1(this)\n")
+Out.write("//}\n\n")
+Out.write("//def installOrder = Verify.getBoolean()\n")
+Out.write("//if (installOrder) {\n")
 Out.write("\tapp1.installed()\n")
 Out.write("\tapp2.installed()\n")
-Out.write("} else {\n")
-Out.write("\tapp2.installed()\n")
-Out.write("\tapp1.installed()\n")
-Out.write("}\n\n")
+Out.write("//} else {\n")
+Out.write("\t//app2.installed()\n")
+Out.write("\t//app1.installed()\n")
+Out.write("//}\n\n")
 for line in eventSimulator:
        Out.write(line)
 Out.close()