[deconz] fix websocketId creation (#9019)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K 2020-11-14 00:02:21 +01:00 committed by GitHub
parent 13a37f0c8c
commit a09123b1a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,11 @@ public class DeconzBridgeHandler extends BaseBridgeHandler implements WebSocketC
this.http = http;
this.gson = gson;
String websocketID = thing.getUID().getAsString().replace(':', '-');
websocketID = websocketID.length() < 3 ? websocketID : websocketID.substring(websocketID.length() - 20);
if (websocketID.length() < 4) {
websocketID = "openHAB-deconz-" + websocketID;
} else if (websocketID.length() > 20) {
websocketID = websocketID.substring(websocketID.length() - 20);
}
this.websocket = new WebSocketConnection(this, webSocketFactory.createWebSocketClient(websocketID), gson);
}