use of org.openhab.binding.pilight.internal.communication.Code in project openhab1-addons by openhab.
the class PilightBinding method createUpdateCommand.
private Action createUpdateCommand(Command command, PilightBindingConfig config) {
Action action = new Action(Action.ACTION_CONTROL);
Code code = new Code();
code.setDevice(config.getDevice());
if (command instanceof OnOffType) {
setOnOffValue((OnOffType) command, code);
} else if (command instanceof PercentType) {
setDimmerValue((PercentType) command, code);
} else {
logger.error("Only OnOffType and PercentType can be changed by the pilight binding");
return null;
}
action.setCode(code);
return action;
}
Aggregations