]> git.basschouten.com Git - openhab-addons.git/commitdiff
fix a bug reported by community: https://community.openhab.org/t/easee-binding/135492...
authoralexf2015 <alexf2015@users.noreply.github.com>
Mon, 10 Oct 2022 07:28:42 +0000 (09:28 +0200)
committerGitHub <noreply@github.com>
Mon, 10 Oct 2022 07:28:42 +0000 (09:28 +0200)
Signed-off-by: Alexander Friese <af944580@googlemail.com>
bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/EaseeBindingConstants.java
bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/model/CustomResponseTransformer.java

index 7d4ebae0142e46defe6ee1f179d72c2034d5dabd..c8cce98f6ff7d69c9854fc92c97dfe16d17067ce 100644 (file)
@@ -150,7 +150,7 @@ public class EaseeBindingConstants {
     public static final String GENERIC_NO = "No";
     public static final int CHARGER_OP_STATE_WAITING = 2;
     public static final int CHARGER_OP_STATE_CHARGING = 3;
-    public static final int CHARGER_DYNAMIC_CURRENT_PAUSE = 0;
+    public static final double CHARGER_DYNAMIC_CURRENT_PAUSE = 0;
     public static final int CHARGER_REASON_FOR_NO_CURRENT_PAUSED = 52;
 
     public static final String THING_CONFIG_ID = "id";
index db43bea10904f084f849332bae54e4a3a34df64f..e5c4bd619e7542299e3daddadaaa6a931c11a34e 100644 (file)
@@ -81,7 +81,7 @@ class CustomResponseTransformer {
     private void updateChargerStartStop(Map<Channel, State> result, String value, JsonObject rawData) {
         Channel channel = channelProvider.getChannel(CHANNEL_GROUP_CHARGER_COMMANDS, CHANNEL_CHARGER_START_STOP);
         if (channel != null) {
-            int val = Integer.valueOf(value);
+            int val = Integer.parseInt(value);
             // state >= 3 will mean charging, ready to charge or charging finished
             boolean charging = val >= CHARGER_OP_STATE_CHARGING;
 
@@ -97,7 +97,7 @@ class CustomResponseTransformer {
     private void updateChargerPauseResume(Map<Channel, State> result, String value) {
         Channel channel = channelProvider.getChannel(CHANNEL_GROUP_CHARGER_COMMANDS, CHANNEL_CHARGER_PAUSE_RESUME);
         if (channel != null) {
-            int val = Integer.valueOf(value);
+            double val = Double.parseDouble(value);
             // value == 0 will mean paused
             boolean paused = val == CHARGER_DYNAMIC_CURRENT_PAUSE;