use of org.eclipse.smarthome.binding.homematic.internal.model.TclScriptDataEntry in project smarthome by eclipse.
the class CcuValueParser method parse.
@Override
public Void parse(TclScriptDataList resultList) throws IOException {
if (resultList.getEntries() != null) {
for (TclScriptDataEntry entry : resultList.getEntries()) {
HmDatapointInfo dpInfo = HmDatapointInfo.createValuesInfo(channel, entry.name);
HmDatapoint dp = channel.getDatapoint(dpInfo);
if (dp != null) {
dp.setValue(convertToType(dp, entry.value));
adjustRssiValue(dp);
} else {
// should never happen, but in case ...
logger.warn("Can't set value for datapoint '{}'", dpInfo);
}
}
}
return null;
}
use of org.eclipse.smarthome.binding.homematic.internal.model.TclScriptDataEntry in project smarthome by eclipse.
the class CcuParamsetDescriptionParser method parse.
@Override
public Void parse(TclScriptDataList resultList) throws IOException {
if (resultList.getEntries() != null) {
for (TclScriptDataEntry entry : resultList.getEntries()) {
HmDatapoint dp = assembleDatapoint(entry.name, entry.unit, entry.valueType, this.toOptionList(entry.options), convertToType(entry.minValue), convertToType(entry.maxValue), toInteger(entry.operations), convertToType(entry.value), paramsetType, isHmIpDevice);
channel.addDatapoint(dp);
}
}
return null;
}
use of org.eclipse.smarthome.binding.homematic.internal.model.TclScriptDataEntry in project smarthome by eclipse.
the class CcuVariablesAndScriptsParser method parse.
@Override
public Void parse(TclScriptDataList resultList) throws IOException {
if (resultList.getEntries() != null) {
for (TclScriptDataEntry entry : resultList.getEntries()) {
HmDatapoint dp = channel.getDatapoint(HmParamsetType.VALUES, entry.name);
if (dp != null) {
dp.setValue(convertToType(entry.value));
} else {
dp = new HmDatapoint();
dp.setName(entry.name);
dp.setInfo(entry.name);
dp.setDescription(entry.description);
dp.setType(HmValueType.parse(entry.valueType));
dp.setValue(convertToType(entry.value));
if (dp.isIntegerType()) {
dp.setMinValue(toInteger(entry.minValue));
dp.setMaxValue(toInteger(entry.maxValue));
} else {
dp.setMinValue(toDouble(entry.minValue));
dp.setMaxValue(toDouble(entry.maxValue));
}
dp.setReadOnly(entry.readOnly);
dp.setUnit(entry.unit);
String[] result = StringUtils.splitByWholeSeparatorPreserveAllTokens(entry.options, ";");
dp.setOptions(result == null || result.length == 0 ? null : result);
if (dp.getOptions() != null) {
dp.setMinValue(0);
dp.setMaxValue(dp.getOptions().length - 1);
}
dp.setParamsetType(HmParamsetType.VALUES);
channel.addDatapoint(dp);
}
}
}
return null;
}
Aggregations