diff --git a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandBridgeHandler.java b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandBridgeHandler.java index 669307af4c9..ed269b6b745 100644 --- a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandBridgeHandler.java +++ b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandBridgeHandler.java @@ -85,7 +85,7 @@ public class TouchWandBridgeHandler extends BaseBridgeHandler implements TouchWa updateStatus(ThingStatus.ONLINE); synchronized (this) { if (isRunning) { - TouchWandWebSockets localSockets = touchWandWebSockets = new TouchWandWebSockets(host, + TouchWandWebSockets localSockets = touchWandWebSockets = new TouchWandWebSockets(host, port, scheduler); localSockets.registerListener(this); localSockets.connect(); diff --git a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java index 97a4241ba2c..17403f98ba7 100644 --- a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java +++ b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java @@ -59,6 +59,7 @@ public class TouchWandWebSockets { private WebSocketClient client; private String controllerAddress; + private int port; private TouchWandSocket touchWandSocket; private boolean isShutDown = false; private CopyOnWriteArraySet listeners = new CopyOnWriteArraySet<>(); @@ -67,17 +68,18 @@ public class TouchWandWebSockets { private ScheduledExecutorService scheduler; - public TouchWandWebSockets(String ipAddress, ScheduledExecutorService scheduler) { + public TouchWandWebSockets(String ipAddress, int port, ScheduledExecutorService scheduler) { client = new WebSocketClient(); touchWandSocket = new TouchWandSocket(); this.controllerAddress = ipAddress; + this.port = port; this.scheduler = scheduler; socketReconnect = null; } public void connect() { try { - uri = new URI("ws://" + controllerAddress + WS_ENDPOINT_TOUCHWAND); + uri = new URI("ws://" + controllerAddress + ":" + String.valueOf(port) + WS_ENDPOINT_TOUCHWAND); } catch (URISyntaxException e) { logger.warn("URI not valid {} message {}", uri, e.getMessage()); return;