From 255c4fa96c66f5b99469127353c73bff8358fa1d Mon Sep 17 00:00:00 2001 From: Seyed Amir Hossein Aqajari Date: Wed, 31 Jul 2019 13:08:09 -0700 Subject: [PATCH] Update color-coordinator.groovy --- official/color-coordinator.groovy | 52 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/official/color-coordinator.groovy b/official/color-coordinator.groovy index dc5dfb7..ee3ef36 100755 --- a/official/color-coordinator.groovy +++ b/official/color-coordinator.groovy @@ -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) -- 2.34.1