From c44f3acb2207f246165bda1a79e135936f88ecc1 Mon Sep 17 00:00:00 2001 From: Seyed Amir Hossein Aqajari Date: Mon, 5 Aug 2019 16:02:59 -0700 Subject: [PATCH] Update gentle-wake-up.groovy --- official/gentle-wake-up.groovy | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/official/gentle-wake-up.groovy b/official/gentle-wake-up.groovy index d8c346f..d4d0c72 100755 --- a/official/gentle-wake-up.groovy +++ b/official/gentle-wake-up.groovy @@ -295,13 +295,13 @@ private initialize() { subscribe(dimmers, "switch.off", stopDimmersHandler) } - if (!getAllChildDevices()) { + /*if (!getAllChildDevices()) { // create controller device and set name to the label used here def dni = "${new Date().getTime()}" log.debug "app.label: ${app.label}" addChildDevice("smartthings", "Gentle Wake Up Controller", dni, null, ["label": app.label]) state.controllerDni = dni - } + }*/ } def appHandler(evt) { @@ -564,17 +564,14 @@ def updateDimmers(percentComplete) { def shouldChangeColors = (colorize && colorize != "false") - if (shouldChangeColors && hasSetColorCommand(dimmer)) { + if (shouldChangeColors/*&& hasSetColorCommand(dimmer)*/) { def hue = getHue(dimmer, nextLevel) log.debug "Setting ${deviceLabel(dimmer)} level to ${nextLevel} and hue to ${hue}" dimmer.setColor([hue: hue, saturation: 100, level: nextLevel]) - } else if (hasSetLevelCommand(dimmer)) { + } else { log.debug "Setting ${deviceLabel(dimmer)} level to ${nextLevel}" dimmer.setLevel(nextLevel) - } else { - log.warn "${deviceLabel(dimmer)} does not have setColor or setLevel commands." } - } } -- 2.34.1