Fixing bugs in infrastructure
[smartthings-infrastructure.git] / ColorControl / ColorControls.groovy
index adac0b8e82c12980af1ab7e684e456dabbb420ef..d17f9e4333f94e02c8fb85fb361b0b0bee28afea 100644 (file)
@@ -10,21 +10,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,
@@ -63,23 +63,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
-       }
 }