Skip to content

Commit

Permalink
Review comment: get an id by hashing the thing UID
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed Feb 5, 2023
1 parent 8de6863 commit d51f766
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ public DeconzBridgeHandler(Bridge thing, WebSocketFactory webSocketFactory, Asyn
websocketID = "deconz-" + thing.getUID().getId();
}
if (websocketID.length() > 20) {
websocketID = "deconz";
String str = Integer.toHexString(thing.getUID().getAsString().hashCode());
if (str.length() > 13) {
str = str.substring(str.length() - 13);
}
websocketID = "deconz-" + str;
}
this.websocket = new WebSocketConnection(this, webSocketFactory.createWebSocketClient(websocketID), gson);
}
Expand Down

0 comments on commit d51f766

Please sign in to comment.