Update WorkingFromHome.groovy
[smartapps.git] / official / color-coordinator.groovy
index dc5dfb702e9a5e924e5815551cd4d8b31a30f8c8..ee3ef360c760fe643366c156ab727f730dd49ea9 100755 (executable)
@@ -33,35 +33,37 @@ preferences {
 }
 
 def mainPage() {
+       section("Master Light") {
+               input "master", "capability.colorControl", title: "Colored Light", required: true
+       }
+       section("Lights that follow the master settings") {
+               input "slaves", "capability.colorControl", title: "Colored Lights",  multiple: true, required: true, submitOnChange: true
+       }
+       section([mobileOnly:true], "Options") {
+               input "randomYes", "bool",title: "When Master Turned On, Randomize Color", defaultValue: false
+               href "pageAbout", title: "About ${textAppName()}", description: "Tap to get application version, license and instructions"
+        }
+       
        dynamicPage(name: "mainPage", title: "", install: true, uninstall: false) {
-               def masterInList = slaves?.id?.find{it==master?.id}
+       def masterInList = slaves?.id?.find{it==master?.id}
         if (masterInList) {
                section ("**WARNING**"){
-               paragraph "You have included the Master Light in the Slave Group. This will cause a loop in execution. Please remove this device from the Slave Group.", image: "https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/img/caution.png"
-            }
+                       paragraph "You have included the Master Light in the Slave Group. This will cause a loop in execution. Please remove this device from the Slave Group.", image: "https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/img/caution.png"
+               }
         }
-        section("Master Light") {
-                       input "master", "capability.colorControl", title: "Colored Light", required: true
-               }
-               section("Lights that follow the master settings") {
-                       input "slaves", "capability.colorControl", title: "Colored Lights",  multiple: true, required: true, submitOnChange: true
+        
+       page(name: "pageAbout", title: "About ${textAppName()}", uninstall: true) {
+                       section {
+                               paragraph "${textVersion()}\n${textCopyright()}\n\n${textLicense()}\n"
+                       }
+                       section("Instructions") {
+                               paragraph textHelp()
+                       }
+                       section("Tap button below to remove application"){
+                       }
                }
-       section([mobileOnly:true], "Options") {
-                       input "randomYes", "bool",title: "When Master Turned On, Randomize Color", defaultValue: false
-                       href "pageAbout", title: "About ${textAppName()}", description: "Tap to get application version, license and instructions"
-        }
-       }
-}
-
-page(name: "pageAbout", title: "About ${textAppName()}", uninstall: true) {
-       section {
-       paragraph "${textVersion()}\n${textCopyright()}\n\n${textLicense()}\n"
-       }
-       section("Instructions") {
-               paragraph textHelp()
+               
        }
-    section("Tap button below to remove application"){
-    }
 }
 
 def installed() {   
@@ -74,8 +76,8 @@ def updated(){
 }
 
 def init() {
-       subscribe(master, "switch", onOffHandler)
-       subscribe(master, "level", colorHandler)
+    subscribe(master, "switch", onOffHandler)
+    subscribe(master, "level", colorHandler)
     subscribe(master, "hue", colorHandler)
     subscribe(master, "saturation", colorHandler)
     subscribe(master, "colorTemperature", tempHandler)