From b30c5b2dd2567206e9b19313610fbd104ebdb373 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Sat, 10 Aug 2019 22:23:50 -0700 Subject: [PATCH] Adding missing methods. --- ColorControl/ColorControl.groovy | 10 ++++++++++ ColorControl/ColorControls.groovy | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/ColorControl/ColorControl.groovy b/ColorControl/ColorControl.groovy index c3d652d..e0a905f 100644 --- a/ColorControl/ColorControl.groovy +++ b/ColorControl/ColorControl.groovy @@ -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) { diff --git a/ColorControl/ColorControls.groovy b/ColorControl/ColorControls.groovy index 90223c5..5eb237b 100644 --- a/ColorControl/ColorControls.groovy +++ b/ColorControl/ColorControls.groovy @@ -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) { -- 2.34.1