Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / ColorControl / ColorControls.groovy
index c74f99b82ae16b2f56cee33b377d0cc7d74eb2cf..68fd6f0b1eed47095fcd38a8edd0b213be82eafe 100644 (file)
@@ -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
-       }
 }