From 8fa8dbfbce4c727ce0d859f458de6c7bf0f7d332 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Sun, 28 Nov 2021 13:31:56 +0100 Subject: [PATCH] [linky] Few debug logs added (#11647) Signed-off-by: Laurent Garnier --- .../openhab/binding/linky/internal/api/EnedisHttpApi.java | 1 + .../openhab/binding/linky/internal/handler/LinkyHandler.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/api/EnedisHttpApi.java b/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/api/EnedisHttpApi.java index 47f964df666aa..025dc2e86fc29 100644 --- a/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/api/EnedisHttpApi.java +++ b/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/api/EnedisHttpApi.java @@ -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"); } diff --git a/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java b/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java index 6b325f0370432..2e16205ad053c 100644 --- a/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java +++ b/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java @@ -369,6 +369,7 @@ private List 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()); } } @@ -385,6 +386,7 @@ private List 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()); } } @@ -401,7 +403,8 @@ private void disconnect() { if (api != null) { try { api.dispose(); - } catch (LinkyException ignore) { + } catch (LinkyException e) { + logger.debug("disconnect: {}", e.getMessage()); } } }