use of org.eclipse.smarthome.binding.homematic.internal.model.HmDevice in project smarthome by eclipse.
the class HomematicDeviceDiscoveryServiceTest method testDiscoveryResultIsReportedForNewDevice.
@Test
public void testDiscoveryResultIsReportedForNewDevice() {
SimpleDiscoveryListener discoveryListener = new SimpleDiscoveryListener();
homematicDeviceDiscoveryService.addDiscoveryListener(discoveryListener);
HmDevice hmDevice = createDimmerHmDevice();
homematicDeviceDiscoveryService.deviceDiscovered(hmDevice);
assertThat(discoveryListener.discoveredResults.size(), is(1));
discoveryResultMatchesHmDevice(discoveryListener.discoveredResults.element(), hmDevice);
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDevice in project smarthome by eclipse.
the class ButtonDatapointTest method createPressDatapoint.
private HmDatapoint createPressDatapoint(String channelName, Object value) {
HmDatapoint pressDp = new HmDatapoint(channelName, "", HmValueType.ACTION, value, true, HmParamsetType.VALUES);
HmChannel hmChannel = new HmChannel(channelName, 1);
HmDevice device = new HmDevice("ABC12345", HmInterface.RF, "HM-MOCK", "mockid", "mockid", "mockfw");
hmChannel.setDevice(device);
device.addChannel(hmChannel);
hmChannel.addDatapoint(pressDp);
pressDp.setChannel(hmChannel);
bvdpHandler.initialize(device);
return pressDp;
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDevice in project smarthome by eclipse.
the class UidUtilsTest method testGeneratedThingTypeUIDHasExpectedFormatForHomegear.
@Test
public void testGeneratedThingTypeUIDHasExpectedFormatForHomegear() {
HmDevice hmDevice = createDimmerHmDevice("HOMEGEAR");
ThingTypeUID generatedThingTypeUID = UidUtils.generateThingTypeUID(hmDevice);
assertThat(generatedThingTypeUID.getAsString(), is("homematic:HG-HM-LC-Dim1-Pl3"));
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDevice in project smarthome by eclipse.
the class UidUtilsTest method testGeneratedThingTypeUIDHasExpectedFormat.
@Test
public void testGeneratedThingTypeUIDHasExpectedFormat() {
HmDevice hmDevice = createDimmerHmDevice();
ThingTypeUID generatedThingTypeUID = UidUtils.generateThingTypeUID(hmDevice);
assertThat(generatedThingTypeUID.getAsString(), is("homematic:HM-LC-Dim1-Pl3"));
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmDevice in project smarthome by eclipse.
the class DimmerHelper method createDimmerHmDevice.
public static HmDevice createDimmerHmDevice(String gatewayType) {
HmDevice hmDevice = new HmDevice("ABC12345678", null, "HM-LC-Dim1-Pl3", gatewayType, "", "1");
hmDevice.setName("Homematic Dimmer");
return hmDevice;
}
Aggregations