From b0eaa9effcc9128ba853a12ce6cf45a7306aaf58 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Sun, 19 Feb 2023 20:58:14 +0100 Subject: [PATCH] [deconz] Adjust thread name for web socket client (#14343) Signed-off-by: Laurent Garnier --- .../deconz/internal/handler/DeconzBridgeHandler.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java index 79f956be936e2..e5369a30ff8a1 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java @@ -46,6 +46,7 @@ import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.thing.binding.BaseBridgeHandler; import org.openhab.core.thing.binding.ThingHandlerService; +import org.openhab.core.thing.util.ThingWebClientUtil; import org.openhab.core.types.Command; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,12 +87,7 @@ public DeconzBridgeHandler(Bridge thing, WebSocketFactory webSocketFactory, Asyn super(thing); this.http = http; this.gson = gson; - String websocketID = thing.getUID().getAsString().replace(':', '-'); - if (websocketID.length() < 4) { - websocketID = "openHAB-deconz-" + websocketID; - } else if (websocketID.length() > 20) { - websocketID = websocketID.substring(websocketID.length() - 20); - } + String websocketID = ThingWebClientUtil.buildWebClientConsumerName(thing.getUID(), null); this.websocket = new WebSocketConnection(this, webSocketFactory.createWebSocketClient(websocketID), gson); }