]> git.basschouten.com Git - openhab-addons.git/commitdiff
[remoteopenhab] Avoid going OFFLINE when request of items states fails (#9287)
authorlolodomo <lg.hc@free.fr>
Tue, 8 Dec 2020 17:22:13 +0000 (18:22 +0100)
committerGitHub <noreply@github.com>
Tue, 8 Dec 2020 17:22:13 +0000 (09:22 -0800)
Related to #9281

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java

index 93ec8bfd490be4a0e3fc46f336fefd8f5837ce11..ff82b104504572ff6a04f71f9c8a41f1bf6fcad6 100644 (file)
@@ -324,12 +324,18 @@ public class RemoteopenhabBridgeHandler extends BaseBridgeHandler
                 updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
                         "OH 1.x server not supported by the binding");
             } else if (getThing().getStatus() != ThingStatus.ONLINE) {
-                List<RemoteopenhabItem> items = restClient.getRemoteItems("name,type,groupType,state,stateDescription");
+                List<RemoteopenhabItem> items = restClient.getRemoteItems("name,type,groupType,stateDescription");
 
                 createChannels(items, true);
                 setStateOptions(items);
-                for (RemoteopenhabItem item : items) {
-                    updateChannelState(item.name, null, item.state);
+
+                try {
+                    items = restClient.getRemoteItems("name,state");
+                    for (RemoteopenhabItem item : items) {
+                        updateChannelState(item.name, null, item.state);
+                    }
+                } catch (RemoteopenhabException e) {
+                    logger.debug("{}", e.getMessage());
                 }
 
                 updateStatus(ThingStatus.ONLINE);