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();
+ List<RemoteopenhabItem> items = restClient.getRemoteItems("name,type,groupType,state,stateDescription");
createChannels(items, true);
setStateOptions(items);
}
}
- public List<RemoteopenhabItem> getRemoteItems() throws RemoteopenhabException {
+ public List<RemoteopenhabItem> getRemoteItems(@Nullable String fields) throws RemoteopenhabException {
try {
String url = String.format("%s?recursive=false", getRestApiUrl("items"));
+ if (fields != null) {
+ url += "&fields=" + fields;
+ }
String jsonResponse = executeUrl(HttpMethod.GET, url, "application/json", null, null);
if (jsonResponse.isEmpty()) {
throw new RemoteopenhabException("JSON response is empty");