X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=blobdiff_plain;f=Location%2FLocationVar.groovy;h=88f34d6a4c0578be1766c8994900fbe2d30d9069;hp=eeaa9472c381f35eb5350a349bc67eb0c55b6f67;hb=e35f41403dabb79b83cf24f31910e0226108835c;hpb=c511e99ce4be1736e0749986d3f84de132bca81d diff --git a/Location/LocationVar.groovy b/Location/LocationVar.groovy index eeaa947..88f34d6 100755 --- a/Location/LocationVar.groovy +++ b/Location/LocationVar.groovy @@ -53,8 +53,19 @@ 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 if (sentMode == "night") { + this.mode = "night" + this.locationMode = "night" + } else { + this.mode = sentMode + this.locationMode = sentMode + } sendEvent(eventDataMap) } }