From: Seyed Amir Hossein Aqajari Date: Mon, 5 Aug 2019 23:02:59 +0000 (-0700) Subject: Update gentle-wake-up.groovy X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartapps.git;a=commitdiff_plain;h=c44f3acb2207f246165bda1a79e135936f88ecc1 Update gentle-wake-up.groovy --- 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." } - } }