Update Light_Rule.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Wed, 7 Aug 2019 00:56:37 +0000 (17:56 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Wed, 7 Aug 2019 00:56:37 +0000 (17:56 -0700)
official/Light_Rule.groovy

index d9c090fac4212a874c428be71830408d63823a14..949c96ca7d53bbfd2eb3d4b61b576144ef3f91b2 100644 (file)
@@ -48,25 +48,20 @@ def mainPage() {
 }
 
 def namePage() {
+       section {
+            input "overrideLabel", "bool", title: "Edit automation name", defaultValue: "false", required: "false", submitOnChange: true
+        }
        if (!overrideLabel) {
         // if the user selects to not change the label, give a default label
         def l = "$contactSensor turns on $light"
         log.debug "will set default label of $l"
-        app.updateLabel(l)
     }
     dynamicPage(name: "namePage") {
         if (overrideLabel) {
             section("Automation name") {
-                label title: "Enter custom name", defaultValue: app.label, required: false
-            }
-        } else {
-            section("Automation name") {
-                paragraph app.label
+                label title: "Enter custom name", required: false
             }
         }
-        section {
-            input "overrideLabel", "bool", title: "Edit automation name", defaultValue: "false", required: "false", submitOnChange: true
-        }
     }
 }