X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=blobdiff_plain;f=ColorControl%2FColorControl.groovy;h=f24d274ad61ed0bf98736a9e1d5679e3378ab099;hp=e0a905f4fe554795279983c62d67d6d0876852ec;hb=4e6463b38690279fa3ea38f4d8ef09827d8d6b09;hpb=b30c5b2dd2567206e9b19313610fbd104ebdb373 diff --git a/ColorControl/ColorControl.groovy b/ColorControl/ColorControl.groovy index e0a905f..f24d274 100644 --- a/ColorControl/ColorControl.groovy +++ b/ColorControl/ColorControl.groovy @@ -127,7 +127,7 @@ public class ColorControl { 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: "", + sendEvent([name: "hue", value: "$hue", deviceId: this.id, descriptionText: "", displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } } @@ -141,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) {