From: rtrimana Date: Mon, 5 Aug 2019 19:39:56 +0000 (-0700) Subject: Fixing a bug in ColorControl. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=098ad07f59670d32abbb3328b76474883219db1e;hp=2da169ef2709a42eefdcc225a4d6d8acb12b675e Fixing a bug in ColorControl. --- diff --git a/ColorControl/ColorControls.groovy b/ColorControl/ColorControls.groovy index 4919ebe..a85298d 100644 --- a/ColorControl/ColorControls.groovy +++ b/ColorControl/ColorControls.groovy @@ -192,17 +192,17 @@ public class ColorControls { } } - def on(String currentSwitch) { - if (currentSwitch != this.currentSwitch) { - this.currentSwitch = currentSwitch - colorControls[0].on(currentSwitch) + def on() { + if (this.currentSwitch != "on") { + this.currentSwitch = "on" + colorControls[0].on() } } - def off(String currentSwitch) { - if (currentSwitch != this.currentSwitch) { - this.currentSwitch = currentSwitch - colorControls[0].off(currentSwitch) + def off() { + if (this.currentSwitch != "off") { + this.currentSwitch = "off" + colorControls[0].off() } }