use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.
the class LightwaveRfWifiLinkTest method testSwitch.
@Test
@Ignore(value = "This is a functional test to ensure the code is working")
public void testSwitch() throws Exception {
LightwaveRfWifiLink wifiLink = new LightwaveRfWifiLink(LIGHTWAVE_IP, TRANSMIT_PORT, RECEIVE_PORT, CONVERTOR, TIME_BETWEEN_COMMANDS, TIMEOUT_OK);
wifiLink.start();
LightwaveRFCommand command = CONVERTOR.convertToLightwaveRfMessage("3", "5", LightwaveRfType.SWITCH, OnOffType.OFF);
wifiLink.sendLightwaveCommand(command);
Thread.sleep(THREAD_SLEEP);
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.
the class LightwaveRfWifiLinkTest method testDimmer.
@Test
@Ignore(value = "This is a functional test to ensure the code is working")
public void testDimmer() throws Exception {
LightwaveRfWifiLink wifiLink = new LightwaveRfWifiLink(LIGHTWAVE_IP, TRANSMIT_PORT, RECEIVE_PORT, CONVERTOR, TIME_BETWEEN_COMMANDS, TIMEOUT_OK);
wifiLink.start();
LightwaveRFCommand command = CONVERTOR.convertToLightwaveRfMessage("2", "2", LightwaveRfType.DIMMER, OnOffType.OFF);
wifiLink.sendLightwaveCommand(command);
Thread.sleep(THREAD_SLEEP);
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.
the class LightwaverfConvertorTest method testConvertFromLightwaveRfMessageOffCommand.
@Test
public void testConvertFromLightwaveRfMessageOffCommand() throws Exception {
LightwaverfConvertor convertor = new LightwaverfConvertor();
LightwaveRFCommand command = convertor.convertFromLightwaveRfMessage("010,!R2D3F0");
LightwaveRFCommand expected = new LightwaveRfOnOffCommand(10, "2", "3", false);
assertEquals(expected, command);
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.
the class LightwaverfConvertorTest method testConvertToLightwaveRfMessageSetTempCommand.
@Test
public void testConvertToLightwaveRfMessageSetTempCommand() throws Exception {
LightwaverfConvertor convertor = new LightwaverfConvertor();
LightwaveRFCommand command = convertor.convertToLightwaveRfMessage("2", null, LightwaveRfType.HEATING_SET_TEMP, new DecimalType(21.5));
LightwaveRFCommand expected = new LightwaveRfSetHeatingTemperatureCommand("200,!R2DhF*tP21.5");
assertEquals(expected.getLightwaveRfCommandString(), command.getLightwaveRfCommandString());
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.
the class LightwaverfConvertorTest method testConvertFromLightwaveRfMessageDimCommand.
@Test
public void testConvertFromLightwaveRfMessageDimCommand() throws Exception {
LightwaverfConvertor convertor = new LightwaverfConvertor();
LightwaveRFCommand command = convertor.convertFromLightwaveRfMessage("010,!R2D3FdP24");
LightwaveRFCommand expected = new LightwaveRfDimCommand(10, "2", "3", 75);
assertEquals(expected, command);
}
Aggregations