From d451648e0e6f5a8fe6426970a6f1d474aa353a24 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Tue, 8 Dec 2020 18:22:13 +0100 Subject: [PATCH] [remoteopenhab] Avoid going OFFLINE when request of items states fails (#9287) Related to #9281 Signed-off-by: Laurent Garnier --- .../internal/handler/RemoteopenhabBridgeHandler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java index 93ec8bfd49..ff82b10450 100644 --- a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java +++ b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java @@ -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 items = restClient.getRemoteItems("name,type,groupType,state,stateDescription"); + List 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); -- 2.47.3