X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=ColorControl%2FColorControls.groovy;h=68fd6f0b1eed47095fcd38a8edd0b213be82eafe;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hp=c74f99b82ae16b2f56cee33b377d0cc7d74eb2cf;hpb=83071d3bcfc33f015ece13868342644498a9dda3;p=smartthings-infrastructure.git diff --git a/ColorControl/ColorControls.groovy b/ColorControl/ColorControls.groovy index c74f99b..68fd6f0 100644 --- a/ColorControl/ColorControls.groovy +++ b/ColorControl/ColorControls.groovy @@ -13,21 +13,21 @@ public class ColorControls extends SmartThings { colorControls = smartThings // Initialization - StringBuilder id = new StringBuilder("colorControlID0") - StringBuilder label = new StringBuilder("colorControl") - StringBuilder displayName = new StringBuilder("colorControl0") - StringBuilder color = new StringBuilder() - MutableInteger hue = new MutableInteger() - MutableInteger saturation = new MutableInteger() + String id = "colorControlID0" + String label = "colorControl" + String displayName = "light" + String color + Integer hue + Integer saturation if (init) { - color.append("Red") - hue.setValue(30) - saturation.setValue(40) + color = "Red" + hue = 30 + saturation = 40 } else { - color.append("Blue") - hue.setValue(50) - saturation.setValue(50) + color = "Blue" + hue = 50 + saturation = 50 } colorControls.add(new ColorControl(sendEvent, id, label, displayName, color, hue, @@ -66,23 +66,4 @@ public class ColorControls extends SmartThings { def off() { colorControls[0].off() } - - // Methods to return values - def getCurrentHue() { - List tmpValues = new ArrayList() - tmpValues.add(colorControls[0].getCurrentHue()) - return tmpValues - } - - def getCurrentSaturation() { - List tmpValues = new ArrayList() - tmpValues.add(colorControls[0].getCurrentSaturation()) - return tmpValues - } - - def getCurrentColor() { - List tmpValues = new ArrayList() - tmpValues.add(colorControls[0].getCurrentColor()) - return tmpValues - } }