use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfSetHeatingTemperatureCommand 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.LightwaveRfSetHeatingTemperatureCommand in project openhab1-addons by openhab.
the class LightwaveRFSenderThreadTest method test.
@Test
public void test() throws Exception {
LightwaveRfSetHeatingTemperatureCommand tempCommand = new LightwaveRfSetHeatingTemperatureCommand("768,!R3DhF*tP18.0");
final LightwaveRfCommandOk okCommand = new LightwaveRfCommandOk("768,OK");
final LightwaveRFSenderThread senderThread = new LightwaveRFSenderThread(mockSocket, "192.168.1.1", 8000, 120000);
executor.schedule(new Runnable() {
@Override
public void run() {
senderThread.okMessageReceived(okCommand);
}
}, 1000, TimeUnit.MILLISECONDS);
senderThread.sendLightwaveCommand(tempCommand);
senderThread.run();
verify(mockSocket, times(1)).send(any(DatagramPacket.class));
}
use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfSetHeatingTemperatureCommand in project openhab1-addons by openhab.
the class LightwaveRfWifiLinkTest method testSetHeating.
@Test
@Ignore(value = "This is a functional test to ensure the code is working")
public void testSetHeating() throws Exception {
LightwaveRfWifiLink wifiLink = new LightwaveRfWifiLink(LIGHTWAVE_IP, TRANSMIT_PORT, RECEIVE_PORT, CONVERTOR, TIME_BETWEEN_COMMANDS, TIMEOUT_OK);
wifiLink.start();
LightwaveRFCommand command = new LightwaveRfSetHeatingTemperatureCommand(100, "4", 17);
wifiLink.sendLightwaveCommand(command);
Thread.sleep(THREAD_SLEEP);
}
Aggregations