X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=blobdiff_plain;f=Location%2FLocationVar.groovy;h=3f28a0bfbe2100dc105cb8968a0fb2238211af80;hp=d10206ba1e1d99a7b0f2ee3aba7ab3d4f67d066c;hb=895bb616c6c2a7ae845b67c2a30dadc646cad9b6;hpb=d00fd74ad7e497d6849c284c6ba69db2d3ec8e65 diff --git a/Location/LocationVar.groovy b/Location/LocationVar.groovy index d10206b..3f28a0b 100644 --- a/Location/LocationVar.groovy +++ b/Location/LocationVar.groovy @@ -5,14 +5,18 @@ class LocationVar { private int contactBookEnabled private def modes private def timeZone + private def hubs private String mode + private String name private List contacts private List phoneNumbers + private String temperatureScale def sendEvent - + private Phrase helloHome LocationVar(Closure sendEvent) { + this.hubs = [[id:0, localIP:"128.195.204.105"]] this.modes = [[name: "home"],[name: "away"],[name: "night"]] this.mode = "home" this.helloHome = new Phrase() @@ -21,6 +25,8 @@ class LocationVar { this.phoneNumbers = [9495379373] this.sendEvent = sendEvent this.timeZone = TimeZone.getTimeZone("America/New_York") + this.name = "hub0" + this.temperatureScale = "F" } //By Model Checker @@ -30,4 +36,9 @@ class LocationVar { this.mode = sentMode sendEvent(eventDataMap) } + + def currentValue(String deviceFeature) { + if (deviceFeature == "sunsetTime" || deviceFeature == "sunset") + return System.currentTimeMillis() + } }