mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[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,
|
||||
"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);
|
||||
|
Loading…
Reference in New Issue
Block a user