X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=PresenceSensor%2FPresenceSensor.groovy;h=5ffc3fd9c7eebcb97dcf63588af8aa6ebcbc3bda;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hp=9c525293ed2551121642ae462ad21c3f03033f65;hpb=83071d3bcfc33f015ece13868342644498a9dda3;p=smartthings-infrastructure.git diff --git a/PresenceSensor/PresenceSensor.groovy b/PresenceSensor/PresenceSensor.groovy index 9c52529..5ffc3fd 100644 --- a/PresenceSensor/PresenceSensor.groovy +++ b/PresenceSensor/PresenceSensor.groovy @@ -4,17 +4,15 @@ import SmartThing.SmartThing public class PresenceSensor extends SmartThing { // id, label, and display name of the device - StringBuilder id = new StringBuilder() - StringBuilder label = new StringBuilder() - StringBuilder displayName = new StringBuilder() - // Features with string values - StringBuilder currentPresence = new StringBuilder() + String id + String label + String displayName // Maps from features to values - HashMap deviceValuesMap = new HashMap() + HashMap deviceValuesMap = new HashMap() // Possible values for eventsSince method - List possibleValues = new ArrayList(); + List possibleValues = new ArrayList(); - PresenceSensor(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder currentPresence) { + PresenceSensor(Closure sendEvent, String id, String label, String displayName, String currentPresence) { deviceValuesMap = deviceValueSmartThing idSmartThing = id labelSmartThing = label @@ -26,15 +24,9 @@ public class PresenceSensor extends SmartThing { this.id = id this.label = label this.displayName = displayName - this.currentPresence = currentPresence possibleValues.add("present") possibleValues.add("not present") deviceValuesMap.put("presence", currentPresence) } - - // Methods to return values - def getCurrentPresence() { - return currentPresence.toString() - } }