- if (newColor != this.color) {
- this.currentColor = newColor
- this.color = newColor
- println("The color of the light is changed to $newColor!")
- sendEvent([name: "color", value: "$newColor", deviceId: this.id, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
- }
- }
-
- def setColor(String color) {
- if (color != this.color) {
- this.currentColor = color
- this.color = color
- println("The color of the light is changed to $color!")
- sendEvent([name: "color", value: "$color", deviceId: this.id, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
- }
- }
-
- def setHue(int 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) {
- 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"}'])
- }