From: rtrimana Date: Fri, 18 Oct 2019 17:19:21 +0000 (-0700) Subject: Changing the writes to the fields into real String values (the listener needs real... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9fc661fe4078c2e34d5a983c09f1641e210f6255;p=smartthings-infrastructure.git Changing the writes to the fields into real String values (the listener needs real values to compare different modes). --- diff --git a/Location/LocationVar.groovy b/Location/LocationVar.groovy index eeaa947..e2cf09b 100755 --- a/Location/LocationVar.groovy +++ b/Location/LocationVar.groovy @@ -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) } }