Adding missing methods.
[smartthings-infrastructure.git] / ColorControl / ColorControl.groovy
index 4878c48b9f82c55e43a105068269d29e1b6f02dc..e0a905f4fe554795279983c62d67d6d0876852ec 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) {
@@ -142,6 +152,16 @@ public class ColorControl {
                }
        }
 
+       def setLevel(long level) {
+               if (level != this.level) {
+                       this.currentLevel = level
+                       this.level = level
+                       println("The level of the light is changed to $level!")
+                       sendEvent([name: "level", value: "$level", deviceId: this.id, descriptionText: "",
+                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+               }
+       }
+
        def setColorTemperature(int colorTemperature) {
                if (colorTemperature != this.colorTemperature) {
                        this.colorTemperature = colorTemperature