import org.openhab.core.thing.binding.BaseBridgeHandler;
import org.openhab.core.thing.binding.ThingHandlerCallback;
import org.openhab.core.thing.binding.ThingHandlerService;
+import org.openhab.core.thing.util.ThingWebClientUtil;
import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType;
import org.slf4j.Logger;
}
private void initializeTouchHttpClient() {
- String httpClientName = thing.getUID().getId();
+ String httpClientName = ThingWebClientUtil.buildWebClientConsumerName(thing.getUID(), null);
try {
httpClientSSETouchEvent = httpClientFactory.createHttpClient(httpClientName);
@Override
public void dispose() {
stopAllJobs();
+ HttpClient localHttpClientSSETouchEvent = this.httpClientSSETouchEvent;
+ if (localHttpClientSSETouchEvent != null) {
+ try {
+ localHttpClientSSETouchEvent.stop();
+ } catch (Exception e) {
+ }
+ this.httpClientSSETouchEvent = null;
+ }
super.dispose();
logger.debug("Disposing handler for Nanoleaf controller {}", getThing().getUID());
}