private def timeZone
private def hubs
private String mode
+ private String locationMode
private String name
private List contacts
private List phoneNumbers
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']
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']
if (this.mode != eventDataMap['value']) {
def sentMode = eventDataMap['value']
println("The location is changed to $sentMode!")
- this.mode = 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)
}
}