Cancelling the changes for field write.
[smartthings-infrastructure.git] / Location / LocationVar.groovy
old mode 100644 (file)
new mode 100755 (executable)
index 99f3429..3f5e46e
@@ -3,13 +3,14 @@ package Location
 
 class LocationVar {
        private int contactBookEnabled
-       private def modes
+    private def modes
        private def timeZone
        private def hubs
-       private String mode
+    private String mode
+       private String locationMode
        private String name
-       private List contacts
-       private List phoneNumbers
+    private List contacts
+    private List phoneNumbers
        private String temperatureScale 
        def sendEvent
        
@@ -21,6 +22,7 @@ class LocationVar {
                                this.hubs = [[id:0, localIP:"128.195.204.105"]]
                                this.modes = [[name: "home"],[name: "away"],[name: "night"]]
                                this.mode = "away"
+                               this.locationMode = "away"
                                this.helloHome = new Phrase()
                                this.contactBookEnabled = 1
                                this.contacts = ['AJ']
@@ -33,6 +35,7 @@ class LocationVar {
                                this.hubs = [[id:0, localIP:"128.195.204.105"]]
                                this.modes = [[name: "home"],[name: "away"],[name: "night"]]
                                this.mode = "home"
+                               this.locationMode = "home"
                                this.helloHome = new Phrase()
                                this.contactBookEnabled = 1
                                this.contacts = ['AJ']
@@ -51,6 +54,7 @@ class LocationVar {
                        def sentMode = eventDataMap['value']
                        println("The location is changed to $sentMode!")
                        this.mode = sentMode
+                       this.locationMode = sentMode
                        sendEvent(eventDataMap)
                }
        }