Search in sources :

Example 1 with LightwaveRfCommandOk

use of org.openhab.binding.lightwaverf.internal.command.LightwaveRfCommandOk 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));
}
Also used : LightwaveRfSetHeatingTemperatureCommand(org.openhab.binding.lightwaverf.internal.command.LightwaveRfSetHeatingTemperatureCommand) DatagramPacket(java.net.DatagramPacket) LightwaveRfCommandOk(org.openhab.binding.lightwaverf.internal.command.LightwaveRfCommandOk) Test(org.junit.Test)

Aggregations

DatagramPacket (java.net.DatagramPacket)1 Test (org.junit.Test)1 LightwaveRfCommandOk (org.openhab.binding.lightwaverf.internal.command.LightwaveRfCommandOk)1 LightwaveRfSetHeatingTemperatureCommand (org.openhab.binding.lightwaverf.internal.command.LightwaveRfSetHeatingTemperatureCommand)1