From 9fc661fe4078c2e34d5a983c09f1641e210f6255 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Fri, 18 Oct 2019 10:19:21 -0700 Subject: [PATCH] Changing the writes to the fields into real String values (the listener needs real values to compare different modes). --- Location/LocationVar.groovy | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) } } -- 2.34.1