use of org.eclipse.smarthome.binding.homematic.internal.model.HmDatapoint 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.HmDatapoint in project smarthome by eclipse.
the class GetParamsetDescriptionParser method parse.
@Override
@SuppressWarnings("unchecked")
public Void parse(Object[] message) throws IOException {
if (!(message[0] instanceof Map)) {
logger.debug("Unexpected datatype '{}', ignoring message", message[0].getClass());
return null;
}
Map<String, Map<String, Object>> dpNames = (Map<String, Map<String, Object>>) message[0];
for (String datapointName : dpNames.keySet()) {
Map<String, Object> dpMeta = dpNames.get(datapointName);
HmDatapoint dp = assembleDatapoint(datapointName, toString(dpMeta.get("UNIT")), toString(dpMeta.get("TYPE")), toOptionList(dpMeta.get("VALUE_LIST")), dpMeta.get("MIN"), dpMeta.get("MAX"), toInteger(dpMeta.get("OPERATIONS")), dpMeta.get("DEFAULT"), paramsetType, isHmIpDevice);
channel.addDatapoint(dp);
}
return null;
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDatapoint in project smarthome by eclipse.
the class AbstractVirtualDatapointHandler method addDatapoint.
/**
* Creates a new datapoint with the given parameters and adds it to the channel.
*/
protected HmDatapoint addDatapoint(HmDevice device, Integer channelNumber, String datapointName, HmValueType valueType, Object value, boolean readOnly) {
HmChannel channel = device.getChannel(channelNumber);
HmDatapoint dp = new HmDatapoint(datapointName, datapointName, valueType, value, readOnly, HmParamsetType.VALUES);
return addDatapoint(channel, dp);
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDatapoint in project smarthome by eclipse.
the class DisplayOptionsVirtualDatapointHandler method sendDatapoint.
private void sendDatapoint(VirtualGateway gateway, HmChannel channel, String dpName, Object newValue) throws IOException, HomematicClientException {
HmDatapointInfo dpInfo = HmDatapointInfo.createValuesInfo(channel, dpName);
HmDatapoint dp = gateway.getDatapoint(dpInfo);
gateway.sendDatapoint(dp, new HmDatapointConfig(), newValue, null);
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDatapoint in project smarthome by eclipse.
the class InstallModeDurationVirtualDatapoint method initialize.
@Override
public void initialize(HmDevice device) {
if (device.isGatewayExtras()) {
HmDatapoint dp = addDatapoint(device, 0, getName(), HmValueType.INTEGER, 60, false);
dp.setMinValue(10);
dp.setMaxValue(300);
}
}
Aggregations