]> git.basschouten.com Git - openhab-addons.git/commitdiff
[linky] Few debug logs added (#11647)
authorlolodomo <lg.hc@free.fr>
Sun, 28 Nov 2021 12:31:56 +0000 (13:31 +0100)
committerGitHub <noreply@github.com>
Sun, 28 Nov 2021 12:31:56 +0000 (13:31 +0100)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/api/EnedisHttpApi.java
bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java

index 47f964df666aad1c4354b70e2e8c904bcd000e76..025dc2e86fc29f42fe9040fa27dfda7123bcd658 100644 (file)
@@ -120,6 +120,7 @@ public class EnedisHttpApi {
             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");
             }
 
index 6b325f0370432091cf0940bad2d331be57c086e7..2e16205ad053cfa7653f1a27628728cdcfa6d08f 100644 (file)
@@ -369,6 +369,7 @@ public class LinkyHandler extends BaseThingHandler {
                 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 @@ public class LinkyHandler extends BaseThingHandler {
                 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 @@ public class LinkyHandler extends BaseThingHandler {
         if (api != null) {
             try {
                 api.dispose();
-            } catch (LinkyException ignore) {
+            } catch (LinkyException e) {
+                logger.debug("disconnect: {}", e.getMessage());
             }
         }
     }