From: Seyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Date: Mon, 5 Aug 2019 20:43:59 +0000 (-0700)
Subject: Update gideon-smart-home.groovy
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5b68ea604370e691268efc4f986d6b45511bcc23;p=smartapps.git

Update gideon-smart-home.groovy
---

diff --git a/official/gideon-smart-home.groovy b/official/gideon-smart-home.groovy
index a198d72..a4a6a67 100755
--- a/official/gideon-smart-home.groovy
+++ b/official/gideon-smart-home.groovy
@@ -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
+   }