Skip to content

Commit

Permalink
[linky] Few debug logs added (openhab#11647)
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored Nov 28, 2021
1 parent 0fca738 commit 8fa8dbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void initialize() throws LinkyException {
if (authData == null || authData.callbacks.size() < 2 || authData.callbacks.get(0).input.isEmpty()
|| authData.callbacks.get(1).input.isEmpty() || !config.username
.equals(Objects.requireNonNull(authData.callbacks.get(0).input.get(0)).valueAsString())) {
logger.debug("auth1 - invalid template for auth data: {}", result.getContentAsString());
throw new LinkyException("Authentication error, the authentication_cookie is probably wrong");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ private List<String> buildReport(LocalDate startDay, LocalDate endDay, @Nullable
updateStatus(ThingStatus.ONLINE);
return consumption;
} catch (LinkyException e) {
logger.debug("Exception when getting consumption data: {}", e.getMessage(), e);
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, e.getMessage());
}
}
Expand All @@ -385,6 +386,7 @@ private List<String> buildReport(LocalDate startDay, LocalDate endDay, @Nullable
updateStatus(ThingStatus.ONLINE);
return consumption;
} catch (LinkyException e) {
logger.debug("Exception when getting power data: {}", e.getMessage(), e);
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, e.getMessage());
}
}
Expand All @@ -401,7 +403,8 @@ private void disconnect() {
if (api != null) {
try {
api.dispose();
} catch (LinkyException ignore) {
} catch (LinkyException e) {
logger.debug("disconnect: {}", e.getMessage());
}
}
}
Expand Down

0 comments on commit 8fa8dbf

Please sign in to comment.