Changing the writes to the fields into real String values (the listener needs real...
authorrtrimana <rtrimana@uci.edu>
Fri, 18 Oct 2019 17:19:21 +0000 (10:19 -0700)
committerrtrimana <rtrimana@uci.edu>
Fri, 18 Oct 2019 17:19:21 +0000 (10:19 -0700)
Location/LocationVar.groovy

index eeaa947..e2cf09b 100755 (executable)
@@ -53,8 +53,16 @@ class LocationVar {
                if (this.mode != eventDataMap['value']) {
                        def sentMode = eventDataMap['value']
                        println("The location is changed to $sentMode!")
-                       this.mode = sentMode
-                       this.locationMode = sentMode
+                       if (sentMode == "home") {
+                               this.mode = "home"
+                               this.locationMode = "home"
+                       } else if (sentMode == "away") {
+                               this.mode = "away"
+                               this.locationMode = "away"
+                       } else {
+                               this.mode = "night"
+                               this.locationMode = "night"
+                       }
                        sendEvent(eventDataMap)
                }
        }