Search in sources :

Example 1 with FHTBindingProvider

use of org.openhab.binding.fht.FHTBindingProvider 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");
        }
    }
}
Also used : FHTBindingProvider(org.openhab.binding.fht.FHTBindingProvider) FHTBindingConfig(org.openhab.binding.fht.FHTBindingConfig) DecimalType(org.openhab.core.library.types.DecimalType)

Aggregations

FHTBindingConfig (org.openhab.binding.fht.FHTBindingConfig)1 FHTBindingProvider (org.openhab.binding.fht.FHTBindingProvider)1 DecimalType (org.openhab.core.library.types.DecimalType)1