import org.openhab.core.thing.ThingUID;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.events.ThingEventFactory;
+import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider;
import org.openhab.core.types.StateDescription;
import org.openhab.core.types.StateDescriptionFragment;
if (!stateDescriptionFragment.equals(oldStateDescriptionFragment)) {
logger.trace("adding state description for channel {}", channelUID);
stateDescriptionFragments.put(channelUID, stateDescriptionFragment);
+ ItemChannelLinkRegistry itemChannelLinkRegistry = this.itemChannelLinkRegistry;
postEvent(ThingEventFactory.createChannelDescriptionChangedEvent(channelUID,
itemChannelLinkRegistry != null ? itemChannelLinkRegistry.getLinkedItemNames(channelUID) : Set.of(),
stateDescriptionFragment, oldStateDescriptionFragment));
String url = buildUrl(config.getHostWithoutPort(), config.httpPort, config.apikey);
return http.get(url, config.timeout).thenApply(r -> {
if (r.getResponseCode() == 403) {
- return Optional.ofNullable((BridgeFullState) null);
+ return Optional.<BridgeFullState> empty();
} else if (r.getResponseCode() == 200) {
return Optional.ofNullable(gson.fromJson(r.getBody(), BridgeFullState.class));
} else {