Adding missing methods.
authorrtrimana <rtrimana@uci.edu>
Sun, 11 Aug 2019 05:23:50 +0000 (22:23 -0700)
committerrtrimana <rtrimana@uci.edu>
Sun, 11 Aug 2019 05:23:50 +0000 (22:23 -0700)
ColorControl/ColorControl.groovy
ColorControl/ColorControls.groovy

index c3d652d1e8aa85090c56c75dcb2d564b368b26b6..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) {
index 90223c54bdd233baf3feb1690ed53477676ef9e9..5eb237bec7fcec7482bc42751373d05c1676885d 100644 (file)
@@ -188,6 +188,14 @@ public class ColorControls {
                        colorControls[0].setHue(hue)
                }
        }
+       
+       def setHue(double hue) {
+               if (hue != this.hue) {
+                       this.hue = hue
+                       this.currentHue = hue
+                       colorControls[0].setHue(hue)
+               }
+       }
 
        def setSaturation(int saturation) {
                if (saturation != this.saturation) {