use of org.openhab.binding.caldav_personal.CalDavBindingProvider in project openhab1-addons by openhab.
the class CalDavBinding method updateItemsForEvent.
private void updateItemsForEvent() {
CalDavBindingProvider bindingProvider = null;
for (CalDavBindingProvider bindingProvider_ : this.providers) {
bindingProvider = bindingProvider_;
}
if (bindingProvider == null) {
logger.error("no binding provider found");
return;
}
Map<Integer, List<CalDavEvent>> eventCache = new HashMap<Integer, List<CalDavEvent>>();
for (String item : bindingProvider.getItemNames()) {
CalDavConfig config = bindingProvider.getConfig(item);
List<CalDavEvent> events = eventCache.get(config.getUniqueEventListKey());
if (events == null) {
CalDavQuery query = getQueryForConfig(config);
events = this.calDavLoader.getEvents(query);
eventCache.put(config.getUniqueEventListKey(), events);
}
this.updateItem(item, config, events);
}
}
Aggregations