@Override
public void handleCommand(ChannelUID channelUID, Command command) {
if (command instanceof RefreshType) {
- if (initFinished) {
- updateStates();
- }
+ updateStates();
}
}
}
configuration = config;
+ updateChannelSet(config);
+ initFinished = true;
if (iCalendarBridge.getStatus() != ThingStatus.ONLINE) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
return;
- } else {
- updateChannelSet(config);
- updateStates();
}
- initFinished = true;
+ updateStates();
}
@Override
* Updates all states and channels. Reschedules an update if no error occurs.
*/
private void updateStates() {
+ if (!initFinished) {
+ logger.debug("Ignoring call for updating states as this instance is not initialized yet.");
+ return;
+ }
final Bridge iCalendarBridge = getBridge();
if (iCalendarBridge == null) {
logger.debug("Bridge not instantiated!");
ThingHandler handler = childThing.getHandler();
if (handler instanceof CalendarUpdateListener) {
try {
+ logger.trace("Notifying {} about fresh calendar.", handler.getThing().getUID());
((CalendarUpdateListener) handler).onCalendarUpdated();
} catch (Exception e) {
logger.trace("The update of a child handler failed. Ignoring.", e);