Search in sources :

Example 1 with LightwaveRFCommand

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);
}
Also used : LightwaveRFCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with LightwaveRFCommand

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);
}
Also used : LightwaveRFCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 3 with LightwaveRFCommand

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);
}
Also used : LightwaveRfOnOffCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand) LightwaveRFCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand) Test(org.junit.Test)

Example 4 with LightwaveRFCommand

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());
}
Also used : LightwaveRfSetHeatingTemperatureCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRfSetHeatingTemperatureCommand) DecimalType(org.openhab.core.library.types.DecimalType) LightwaveRFCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand) Test(org.junit.Test)

Example 5 with LightwaveRFCommand

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);
}
Also used : LightwaveRFCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand) LightwaveRfDimCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRfDimCommand) Test(org.junit.Test)

Aggregations

LightwaveRFCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand)13 Test (org.junit.Test)11 LightwaveRfOnOffCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand)4 Ignore (org.junit.Ignore)3 LightwaveRfDimCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRfDimCommand)2 LightwaveRfSetHeatingTemperatureCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRfSetHeatingTemperatureCommand)2 CountDownLatch (java.util.concurrent.CountDownLatch)1 LightwaveRfDeviceRegistrationCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRfDeviceRegistrationCommand)1 DecimalType (org.openhab.core.library.types.DecimalType)1 PercentType (org.openhab.core.library.types.PercentType)1