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) {
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."
}
-
}
}