use of org.eclipse.smarthome.binding.homematic.internal.model.HmChannel in project smarthome by eclipse.
the class AbstractHomematicGateway method prepareDevice.
/**
* Adds virtual datapoints to the device.
*/
private void prepareDevice(HmDevice device) {
for (VirtualDatapointHandler vdph : virtualDatapointHandlers) {
vdph.initialize(device);
}
devices.put(device.getAddress(), device);
logger.debug("Loaded device '{}' ({}) with {} datapoints", device.getAddress(), device.getType(), device.getDatapointCount());
if (logger.isTraceEnabled()) {
logger.trace("{}", device);
for (HmChannel channel : device.getChannels()) {
logger.trace(" {}", channel);
for (HmDatapoint dp : channel.getDatapoints()) {
logger.trace(" {}", dp);
}
}
}
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmChannel in project smarthome by eclipse.
the class AbstractHomematicGateway method createGatewayDevice.
/**
* Creates a virtual device for handling variables, scripts and other special gateway functions.
*/
private HmDevice createGatewayDevice() {
String type = String.format("%s-%s", HmDevice.TYPE_GATEWAY_EXTRAS, StringUtils.upperCase(id));
HmDevice device = new HmDevice(HmDevice.ADDRESS_GATEWAY_EXTRAS, getDefaultInterface(), type, config.getGatewayInfo().getId(), null, null);
device.setName(HmDevice.TYPE_GATEWAY_EXTRAS);
device.addChannel(new HmChannel(HmChannel.TYPE_GATEWAY_EXTRAS, HmChannel.CHANNEL_NUMBER_EXTRAS));
device.addChannel(new HmChannel(HmChannel.TYPE_GATEWAY_VARIABLE, HmChannel.CHANNEL_NUMBER_VARIABLE));
device.addChannel(new HmChannel(HmChannel.TYPE_GATEWAY_SCRIPT, HmChannel.CHANNEL_NUMBER_SCRIPT));
return device;
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmChannel in project smarthome by eclipse.
the class RpcClientTest method valuesParamsetDescriptionIsLoadedForChannel.
@Test
public void valuesParamsetDescriptionIsLoadedForChannel() throws IOException {
HmChannel channel = createDimmerHmChannel();
rpcClient.addChannelDatapoints(channel, HmParamsetType.VALUES);
assertThat(rpcClient.numberOfCalls.get(GET_PARAMSET_DESCRIPTION_NAME), is(1));
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmChannel in project smarthome by eclipse.
the class RpcClientTest method masterParamsetDescriptionIsLoadedForDummyChannel.
@Test
public void masterParamsetDescriptionIsLoadedForDummyChannel() throws IOException {
HmChannel channel = createDimmerDummyChannel();
rpcClient.addChannelDatapoints(channel, HmParamsetType.MASTER);
assertThat(rpcClient.numberOfCalls.get(GET_PARAMSET_DESCRIPTION_NAME), is(1));
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmChannel in project smarthome by eclipse.
the class RpcClientTest method valuesParamsetDescriptionIsNotLoadedForDummyChannel.
@Test
public void valuesParamsetDescriptionIsNotLoadedForDummyChannel() throws IOException {
HmChannel channel = createDimmerDummyChannel();
rpcClient.addChannelDatapoints(channel, HmParamsetType.VALUES);
assertThat(rpcClient.numberOfCalls.get(GET_PARAMSET_DESCRIPTION_NAME), is(0));
}
Aggregations