sendOff(bulb, bridgeId);
}
if (IncreaseDecreaseType.INCREASE.equals(command)) {
sendOn(bulb, bridgeId);
Thread.sleep(100);
PercentType newValue = sendIncrease(bulb, rgbwSteps, bridgeId);
eventPublisher.postUpdate(itemName, newValue);
} else if (IncreaseDecreaseType.DECREASE.equals(command)) {
PercentType newValue = sendDecrease(bulb, rgbwSteps, bridgeId);
eventPublisher.postUpdate(itemName, newValue);
} else if (command instanceof PercentType) {
logger.debug("milight: command is of type PercentType");
sendPercent(bulb, rgbwSteps, bridgeId, (PercentType) command, BindingType.brightness);
}
}
else if (deviceConfig.getCommandType().equals(BindingType.nightMode)) {
logger.debug("milight: item is of type nightMode");
if (OnOffType.ON.equals(command)) {
sendNightMode(bulb, bridgeId);
}
if (OnOffType.OFF.equals(command)) {
sendOff(bulb, bridgeId);
}
}
else if (deviceConfig.getCommandType().equals(BindingType.whiteMode)) {
logger.debug("milight: item is of type whiteMode");
if (OnOffType.ON.equals(command)) {
sendOn(bulb, bridgeId);
Thread.sleep(100);
sendWhiteMode(bulb, bridgeId);
}
if (OnOffType.OFF.equals(command)) {
sendOff(bulb, bridgeId);
}
}
else if (deviceConfig.getCommandType().equals(BindingType.colorTemperature)) {
logger.debug("milight: item is of type warm/cold white");
if (OnOffType.ON.equals(command)) {
sendPercent(bulb, rgbwSteps, bridgeId, PercentType.HUNDRED, BindingType.colorTemperature);
} else if (OnOffType.OFF.equals(command)) {
sendPercent(bulb, rgbwSteps, bridgeId, PercentType.ZERO, BindingType.colorTemperature);
} else if (IncreaseDecreaseType.INCREASE.equals(command)) {
PercentType newValue = sendWarmer(bulb, bridgeId);
eventPublisher.postUpdate(itemName, newValue);
} else if (IncreaseDecreaseType.DECREASE.equals(command)) {
PercentType newValue = sendCooler(bulb, bridgeId);
eventPublisher.postUpdate(itemName, newValue);
} else if (command instanceof PercentType) {
sendPercent(bulb, rgbwSteps, bridgeId, (PercentType) command, BindingType.colorTemperature);
}
}