String ga = (segments.length == 1) ? segments[0].trim() : segments[1].trim();
// create group address and datapoint
GroupAddress groupAddress = new GroupAddress(ga);
Datapoint dp;
if (j != 0 || item.getAcceptedCommandTypes().size() == 0) {
dp = new StateDP(groupAddress, item.getName(), 0, dptID);
} else {
dp = new CommandDP(groupAddress, item.getName(), 0, dptID);
}
// assign datapoint to configuration item
if (configItem.mainDataPoint == null) {
configItem.mainDataPoint = dp;
}
if (isReadable) {
configItem.readableDataPoint = dp;
}
if(!configItem.allDataPoints.contains(dp)) {
configItem.allDataPoints.add(dp);
} else {
throw new BindingConfigParseException(
"Datapoint '"+dp.getDPT() + "' already exists for item '"+item.getName()+"'.");
}
}
config.add(configItem);