Update gideon-smart-home.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Mon, 5 Aug 2019 20:43:59 +0000 (13:43 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Mon, 5 Aug 2019 20:43:59 +0000 (13:43 -0700)
official/gideon-smart-home.groovy

index a198d726d29844eea1a219aad2f1cef06f949cda..a4a6a67c0b71b99b386de01de753de9e0cba3918 100755 (executable)
@@ -78,26 +78,6 @@ preferences {
     }
 }
 
-def installed() {
-       log.debug "Installed with settings: ${settings}"
-
-       initialize()
-}
-
-def updated() {
-       log.debug "Updated with settings: ${settings}"
-
-       unsubscribe()
-       initialize()
-}
-
-def initialize() {
-}
-
-private device(it, type) {
-       it ? [id: it.id, label: it.label, type: type] : null
-}
-
 //API Mapping
 mappings {
    path("/getalldevices") {
@@ -284,6 +264,27 @@ mappings {
   }
 }
 
+def installed() {
+       log.debug "Installed with settings: ${settings}"
+
+       initialize()
+}
+
+def updated() {
+       log.debug "Updated with settings: ${settings}"
+
+       unsubscribe()
+       initialize()
+}
+
+def initialize() {
+}
+
+private device(it, type) {
+       it ? [id: it.id, label: it.label, type: type] : null
+}
+
+
 //API Methods
 def getAllDevices() {
     def locks_list = locks.collect{device(it,"Lock")}
@@ -791,4 +792,4 @@ def getTempSensorsStatus(id) {
                def bat = getBatteryStatus(device.id)
                return [temperature: device.currentValue('temperature')] + bat
                }
-   }
\ No newline at end of file
+   }