Adding missing methods; rearranging initial values.
[smartthings-infrastructure.git] / ColorControl / ColorControl.groovy
index c3d652d1e8aa85090c56c75dcb2d564b368b26b6..f24d274ad61ed0bf98736a9e1d5679e3378ab099 100644 (file)
@@ -121,6 +121,16 @@ public class ColorControl {
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                }
        }
+       
+       def setHue(double hue) {
+               if (hue != this.hue) {
+                       this.hue = hue
+                       this.currentHue = hue
+                       println("The hue level of the light is changed to $hue!")
+                       sendEvent([name: "hue", value: "$hue", deviceId: this.id, descriptionText: "",
+                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+               }
+       }
 
        def setSaturation(int saturation) {
                if (saturation != this.saturation) {
@@ -131,6 +141,17 @@ public class ColorControl {
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                }
        }
+       
+       def setSaturation(double saturation) {
+               if (saturation != this.saturation) {
+                       this.currentSaturation = saturation
+                       this.saturation = saturation
+                       println("The saturation level of the light is changed to $saturation!")
+                       sendEvent([name: "saturation", value: "$saturation", deviceId: this.id, descriptionText: "",
+                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+               }
+       }
+
 
        def setLevel(int level) {
                if (level != this.level) {