]> git.basschouten.com Git - openhab-addons.git/commitdiff
[goecharger] Fix compatibility with go-eCharger V3 (#12733)
authorlolodomo <lg.hc@free.fr>
Mon, 16 May 2022 08:27:19 +0000 (10:27 +0200)
committerGitHub <noreply@github.com>
Mon, 16 May 2022 08:27:19 +0000 (10:27 +0200)
Also avoid the thing to remain in state UNKNOWN if the decoding of the
JSON response is failing.

Fix #12719

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/api/GoEStatusResponseV2DTO.java
bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/handler/GoEChargerBaseHandler.java

index 37f903cc634f537d1ad9c19da0341651d4ee6264..c65c63b22bc7ed585ecf29b5d438cff867b9c893 100644 (file)
@@ -34,7 +34,7 @@ public class GoEStatusResponseV2DTO extends GoEStatusResponseBaseDTO {
     public Double[] temperatures;
 
     @SerializedName("wh")
-    public Long sessionChargeConsumption;
+    public Double sessionChargeConsumption;
 
     @SerializedName("dwo")
     public Double sessionChargeConsumptionLimit;
index 9711b7767c7b2e796e0b83f39ec22f036414b3b4..d0ac23d3c938a7ee86fe94f637f907b52b8430c0 100644 (file)
@@ -142,7 +142,7 @@ public abstract class GoEChargerBaseHandler extends BaseThingHandler {
             } catch (InterruptedException ie) {
                 Thread.currentThread().interrupt();
                 updateChannelsAndStatus(null, ie.getMessage());
-            } catch (TimeoutException | ExecutionException e) {
+            } catch (TimeoutException | ExecutionException | JsonSyntaxException e) {
                 updateChannelsAndStatus(null, e.getMessage());
             }
         }