Search in sources :

Example 11 with LightwaveRFCommand

use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.

the class LightwaverfConvertorTest method testConvertToLightwaveRfMessageOnCommand.

@Test
public void testConvertToLightwaveRfMessageOnCommand() throws Exception {
    LightwaverfConvertor convertor = new LightwaverfConvertor();
    LightwaveRFCommand command = convertor.convertToLightwaveRfMessage("2", "3", LightwaveRfType.SWITCH, OnOffType.ON);
    LightwaveRFCommand expected = new LightwaveRfOnOffCommand("200,!R2D3F1");
    assertEquals(expected.getLightwaveRfCommandString(), command.getLightwaveRfCommandString());
}
Also used : LightwaveRfOnOffCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand) LightwaveRFCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand) Test(org.junit.Test)

Example 12 with LightwaveRFCommand

use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.

the class LightwaverfConvertorTest method testConvertFromLightwaveRfMessageOnCommand.

@Test
public void testConvertFromLightwaveRfMessageOnCommand() throws Exception {
    LightwaverfConvertor convertor = new LightwaverfConvertor();
    LightwaveRFCommand command = convertor.convertFromLightwaveRfMessage("010,!R2D3F1");
    LightwaveRFCommand expected = new LightwaveRfOnOffCommand(10, "2", "3", true);
    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 13 with LightwaveRFCommand

use of org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand in project openhab1-addons by openhab.

the class LightwaverfConvertorTest method testConvertToLightwaveRfMessageDimCommand.

@Test
public void testConvertToLightwaveRfMessageDimCommand() throws Exception {
    LightwaverfConvertor convertor = new LightwaverfConvertor();
    LightwaveRFCommand command = convertor.convertToLightwaveRfMessage("2", "3", LightwaveRfType.DIMMER, new PercentType(75));
    LightwaveRFCommand expected = new LightwaveRfDimCommand("200,!R2D3FdP24");
    assertEquals(expected.getLightwaveRfCommandString(), command.getLightwaveRfCommandString());
}
Also used : PercentType(org.openhab.core.library.types.PercentType) 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