]> git.basschouten.com Git - openhab-addons.git/commitdiff
[deconz] Adjust thread name for web socket client (#14343)
authorlolodomo <lg.hc@free.fr>
Sun, 19 Feb 2023 19:58:14 +0000 (20:58 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Feb 2023 19:58:14 +0000 (20:58 +0100)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java

index 79f956be936e2dc2ada88996f60c00c336b9d9b5..e5369a30ff8a1eddd65d93c69d6e4c97fa0399f0 100644 (file)
@@ -46,6 +46,7 @@ import org.openhab.core.thing.ThingStatusDetail;
 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 class DeconzBridgeHandler extends BaseBridgeHandler implements WebSocketC
         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);
     }