mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[mycroft] Adjust thread name for web socket client (#14342)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
b0eaa9effc
commit
fa87a1b2f4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user