[deconz] Fix compiler warning (#12403)

* Fix compiler warning and info.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
pull/12410/head
Jacob Laursen 2022-03-03 10:15:45 +01:00 committed by GitHub
parent 93e3a710e1
commit c5a2a1fbdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import org.openhab.core.thing.ChannelUID;
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;
@ -58,6 +59,7 @@ public class DeconzDynamicStateDescriptionProvider extends BaseDynamicStateDescr
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));

View File

@ -175,7 +175,7 @@ public class DeconzBridgeHandler extends BaseBridgeHandler implements WebSocketC
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 {