Commit #9: More classes + Extractor with Rahmadi's editions + Fixing some bugs
[smartthings-infrastructure.git] / Extractor / App2 / App2.groovy
index ce2ea22d24d346b9ac174d1683c781338bb8ba9a..497be4134d1d9d6286a836019e8b0e6c897c801f 100644 (file)
@@ -1,4 +1,19 @@
-////////////////
+/**
+ *  NFC Tag Toggle
+ *
+ *  Copyright 2014 SmartThings
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ *  in compliance with the License. You may obtain a copy of the License at:
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
+ *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
+ *  for the specific language governing permissions and limitations under the License.
+ *
+ */
 definition(
     name: "NFC Tag Toggle",
     namespace: "smartthings",
@@ -21,18 +36,18 @@ preferences {
             input "garageDoor", "capability.doorControl", title: "Garage door controller", required: false, multiple: true
         }
     }
-
+    
     page(name: "pageTwo", title: "Master devices", install: true, uninstall: true)
 }
 
 def pageTwo() {
        dynamicPage(name: "pageTwo") {
-       section("If set, the state of these devices will be toggled each time the tag is touched, " +
+       section("If set, the state of these devices will be toggled each time the tag is touched, " + 
                 "e.g. a light that's on will be turned off and one that's off will be turned on, " +
                 "other devices of the same type will be set to the same state as their master device. " +
                 "If no master is designated then the majority of devices of the same type will be used " +
                 "to determine whether to turn on or off the devices.") {
-
+            
             if (switch1 || masterSwitch) {
                 input "masterSwitch", "enum", title: "Master switch", options: switch1.collect{[(it.id): it.displayName]}, required: false
             }
@@ -41,12 +56,12 @@ def pageTwo() {
             }
             if (garageDoor || masterDoor) {
                 input "masterDoor", "enum", title: "Master door", options: garageDoor.collect{[(it.id): it.displayName]}, required: false
-            }
+            }            
                }
                section([mobileOnly:true]) {
                        label title: "Assign a name", required: false
                        mode title: "Set for specific mode(s)", required: false
-               }
+               }        
     }
 }
 
@@ -101,7 +116,7 @@ def touchHandler(evt) {
             }
         }
     }
-
+    
     if (lock) {
        def status = currentStatus(lock, masterLock, "lock")
         lock.each {
@@ -113,7 +128,7 @@ def touchHandler(evt) {
             }
         }
     }
-
+    
     if (garageDoor) {
         def status = currentStatus(garageDoor, masterDoor, "status")
        garageDoor.each {