use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand 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.LightwaveRfOnOffCommand in project openhab1-addons by openhab.
the class LightwaverfConvertorTest method testConvertToLightwaveRfMessageOffCommand.
@Test
public void testConvertToLightwaveRfMessageOffCommand() throws Exception {
LightwaverfConvertor convertor = new LightwaverfConvertor();
LightwaveRFCommand command = convertor.convertToLightwaveRfMessage("2", "3", LightwaveRfType.SWITCH, OnOffType.OFF);
LightwaveRFCommand expected = new LightwaveRfOnOffCommand("200,!R2D3F0");
assertEquals(expected.getLightwaveRfCommandString(), command.getLightwaveRfCommandString());
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand 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());
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand 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);
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfOnOffCommand in project openhab1-addons by openhab.
the class LightwaveRfBindingTest method testRoomDeviceMessageRecevied.
@Test
public void testRoomDeviceMessageRecevied() {
when(mockBindingProvider.getBindingItemsForRoomDevice("2", "3")).thenReturn(Arrays.asList("MySwitch"));
when(mockBindingProvider.getTypeForItemName("MySwitch")).thenReturn(LightwaveRfType.SWITCH);
when(mockBindingProvider.getDirection("MySwitch")).thenReturn(LightwaveRfItemDirection.IN_AND_OUT);
LightwaveRfBinding binding = new LightwaveRfBinding();
binding.addBindingProvider(mockBindingProvider);
binding.setEventPublisher(mockEventPublisher);
binding.roomDeviceMessageReceived(new LightwaveRfOnOffCommand(1, "2", "3", true));
verify(mockEventPublisher).postUpdate("MySwitch", OnOffType.ON);
}
Aggregations