[goecharger] Fix compatibility with go-eCharger V3 (#12733)

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>
This commit is contained in:
lolodomo 2022-05-16 10:27:19 +02:00 committed by GitHub
parent 78813efbd2
commit cff0629fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View 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;

View 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());
}
}