Search in sources :

Example 1 with LightwaveRfDimCommand

use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfDimCommand 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)

Example 2 with LightwaveRfDimCommand

use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfDimCommand 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

Test (org.junit.Test)2 LightwaveRFCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRFCommand)2 LightwaveRfDimCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRfDimCommand)2 PercentType (org.openhab.core.library.types.PercentType)1