Skip to content

Commit

Permalink
[mycroft] Adjust thread name for web socket client (#14342)
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo authored Feb 19, 2023
1 parent b0eaa9e commit fa87a1b
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.thing.binding.BaseThingHandler;
import org.openhab.core.thing.util.ThingWebClientUtil;
import org.openhab.core.types.Command;
import org.openhab.core.types.State;
import org.slf4j.Logger;
Expand Down Expand Up @@ -126,13 +127,7 @@ public void initialize() {

logger.debug("Start initializing Mycroft {}", thing.getUID());

String websocketID = thing.getUID().getAsString().replace(':', '-');
if (websocketID.length() < 4) {
websocketID = "mycroft-" + websocketID;
}
if (websocketID.length() > 20) {
websocketID = websocketID.substring(websocketID.length() - 20);
}
String websocketID = ThingWebClientUtil.buildWebClientConsumerName(thing.getUID(), null);
this.connection = new MycroftConnection(this, webSocketFactory.createWebSocketClient(websocketID));

config = getConfigAs(MycroftConfiguration.class);
Expand Down

0 comments on commit fa87a1b

Please sign in to comment.