X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=CarbonMonoxideDetector%2FCarbonMonoxideDetector.groovy;fp=CarbonMonoxideDetector%2FCarbonMonoxideDetector.groovy;h=045a415668fa4e08a2b0d13858583b3d46104813;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hp=65f1ce0d99bf1209a2988e8888753d287fb1b6fc;hpb=83071d3bcfc33f015ece13868342644498a9dda3;p=smartthings-infrastructure.git diff --git a/CarbonMonoxideDetector/CarbonMonoxideDetector.groovy b/CarbonMonoxideDetector/CarbonMonoxideDetector.groovy index 65f1ce0..045a415 100644 --- a/CarbonMonoxideDetector/CarbonMonoxideDetector.groovy +++ b/CarbonMonoxideDetector/CarbonMonoxideDetector.groovy @@ -4,16 +4,14 @@ import SmartThing.SmartThing public class CarbonMonoxideDetector 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 currentCarbonMonoxideValue = new StringBuilder() + String id + String label + String displayName // Maps from features to values - HashMap deviceValuesMap = new HashMap() + HashMap deviceValuesMap = new HashMap() - CarbonMonoxideDetector(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, StringBuilder currentCarbonMonoxideValue) { - deviceValuesMap = deviceValueSmartThing + CarbonMonoxideDetector(Closure sendEvent, String id, String label, String displayName, String currentCarbonMonoxideValue) { + deviceValueSmartThing = deviceValuesMap idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName @@ -23,13 +21,7 @@ public class CarbonMonoxideDetector extends SmartThing { this.id = id this.label = label this.displayName = displayName - this.currentCarbonMonoxideValue = currentCarbonMonoxideValue deviceValuesMap.put("carbonMonoxide", currentCarbonMonoxideValue) } - - // Methods to return values - def getCurrentCarbonMonoxideValue() { - return currentCarbonMonoxideValue.toString() - } }