use of org.openhab.binding.fht.FHTBindingConfig in project openhab1-addons by openhab.
the class FHTBinding method receivedNewDesiredTemperature.
private void receivedNewDesiredTemperature(String deviceAddress, double temperature) {
FHTBindingConfig config = getConfig(deviceAddress, Datapoint.DESIRED_TEMP);
if (config != null) {
logger.debug("Updating item " + config.getItem().getName() + " with new desired temperature " + temperature);
DecimalType state = new DecimalType(temperature);
eventPublisher.postUpdate(config.getItem().getName(), state);
} else {
logger.debug("Received new desired temperature for currently unknown device with address " + deviceAddress);
}
}
use of org.openhab.binding.fht.FHTBindingConfig in project openhab1-addons by openhab.
the class FHTBinding method internalReceiveCommand.
/**
* @{inheritDoc
*/
@Override
protected void internalReceiveCommand(String itemName, Command command) {
if (!checkCULDevice()) {
return;
}
logger.debug("internalReceiveCommand() is called!");
FHTBindingConfig config = null;
for (FHTBindingProvider provider : providers) {
config = provider.getConfigByItemName(itemName);
if (config != null) {
break;
}
}
if (config != null) {
if (Datapoint.DESIRED_TEMP == config.getDatapoint() && command instanceof DecimalType) {
setDesiredTemperature(config, (DecimalType) command);
} else if (Datapoint.VALVE == config.getDatapoint() && command instanceof DecimalType) {
setValvePosition(config, (DecimalType) command);
} else {
logger.error("You can only manipulate the desired temperature or valve position via commands, all other data points are read only");
}
}
}
Aggregations