use of org.openhab.habdroid.model.OpenHABSitemap in project openhab-android by openhab.
the class Util method parseSitemapList.
public static List<OpenHABSitemap> parseSitemapList(JSONArray jsonArray) {
List<OpenHABSitemap> sitemapList = new ArrayList<OpenHABSitemap>();
for (int i = 0; i < jsonArray.length(); i++) {
try {
JSONObject sitemapJson = jsonArray.getJSONObject(i);
OpenHABSitemap openHABSitemap = OpenHABSitemap.fromJson(sitemapJson);
if (!(openHABSitemap.name().equals("_default") && jsonArray.length() != 1)) {
sitemapList.add(openHABSitemap);
}
} catch (JSONException e) {
Log.d(TAG, "Error while parsing sitemap", e);
}
}
return sitemapList;
}
Aggregations