[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.ThingStatus;
|
||||||
import org.openhab.core.thing.ThingStatusDetail;
|
import org.openhab.core.thing.ThingStatusDetail;
|
||||||
import org.openhab.core.thing.binding.BaseThingHandler;
|
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.Command;
|
||||||
import org.openhab.core.types.State;
|
import org.openhab.core.types.State;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -126,13 +127,7 @@ public class MycroftHandler extends BaseThingHandler implements MycroftConnectio
|
|||||||
|
|
||||||
logger.debug("Start initializing Mycroft {}", thing.getUID());
|
logger.debug("Start initializing Mycroft {}", thing.getUID());
|
||||||
|
|
||||||
String websocketID = thing.getUID().getAsString().replace(':', '-');
|
String websocketID = ThingWebClientUtil.buildWebClientConsumerName(thing.getUID(), null);
|
||||||
if (websocketID.length() < 4) {
|
|
||||||
websocketID = "mycroft-" + websocketID;
|
|
||||||
}
|
|
||||||
if (websocketID.length() > 20) {
|
|
||||||
websocketID = websocketID.substring(websocketID.length() - 20);
|
|
||||||
}
|
|
||||||
this.connection = new MycroftConnection(this, webSocketFactory.createWebSocketClient(websocketID));
|
this.connection = new MycroftConnection(this, webSocketFactory.createWebSocketClient(websocketID));
|
||||||
|
|
||||||
config = getConfigAs(MycroftConfiguration.class);
|
config = getConfigAs(MycroftConfiguration.class);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user