[remoteopenhab] Avoid going OFFLINE when request of items states fails (#9287)
Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
ce5d5ca61d
commit
d451648e0e
|
@ -324,12 +324,18 @@ public class RemoteopenhabBridgeHandler extends BaseBridgeHandler
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
|
||||||
"OH 1.x server not supported by the binding");
|
"OH 1.x server not supported by the binding");
|
||||||
} else if (getThing().getStatus() != ThingStatus.ONLINE) {
|
} 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);
|
createChannels(items, true);
|
||||||
setStateOptions(items);
|
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);
|
updateStatus(ThingStatus.ONLINE);
|
||||||
|
|
Loading…
Reference in New Issue