[mycroft] Adjust thread name for web socket client (#14342)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2023-02-19 20:59:18 +01:00 committed by GitHub
parent b0eaa9effc
commit fa87a1b2f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,7 @@ import org.openhab.core.thing.Thing;
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;
@ -126,13 +127,7 @@ public class MycroftHandler extends BaseThingHandler implements MycroftConnectio
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);