Update color-coordinator.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Wed, 31 Jul 2019 20:08:09 +0000 (13:08 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Wed, 31 Jul 2019 20:08:09 +0000 (13:08 -0700)
official/color-coordinator.groovy

index dc5dfb7..ee3ef36 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)