Update Switches.groovy
authorRahmadi Trimananda <rahmadi.trimananda@uci.edu>
Thu, 8 Aug 2019 22:38:25 +0000 (15:38 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Thu, 8 Aug 2019 22:38:25 +0000 (15:38 -0700)
third-party/Switches.groovy

index 3f8ea924b26b2991cb47bb07bae475f96983ec23..3a2286815b7edc078cefce38082a4c13547fd187 100755 (executable)
@@ -21,6 +21,17 @@ definition(
     iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
     iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")
 
+preferences {
+  page(name: selectSwitches)
+}
+
+def selectSwitches() {
+    dynamicPage(name: "selectSwitches", title: "Switches", install: true) {
+        section("Select switches named after Hello Home phrases") {
+            input "switches", "capability.switch", title: "Switches", multiple: true
+        }
+    }
+}
 
 def installed() {
     initialize()
@@ -46,15 +57,3 @@ def switchHandler(evt) {
     setLocationMode(mode)
   }
 }
-
-preferences {
-  page(name: selectSwitches)
-}
-
-def selectSwitches() {
-    dynamicPage(name: "selectSwitches", title: "Switches", install: true) {
-        section("Select switches named after Hello Home phrases") {
-            input "switches", "capability.switch", title: "Switches", multiple: true
-        }
-    }
-}