]> git.basschouten.com Git - openhab-addons.git/commitdiff
[tesla] Remove the minimum 5A charge current limit (#15711)
authoruqs <uspoerlein@gmail.com>
Wed, 11 Oct 2023 21:10:37 +0000 (23:10 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Oct 2023 21:10:37 +0000 (23:10 +0200)
While the app can't go lower than 5A, the API allows setting values down
to 0A, and at least going to 2-3A can make sense if you want to put
excess solar power into the car without also drawing some from the grid.

Due to the overhead this causes it can be wasteful, so keep logging the
warning about going below 5A.

Signed-off-by: Ulrich Spörlein <uspoerlein@gmail.com>
bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaVehicleHandler.java

index 826316f5e6ef558dde69403e56630ad1cfb7f878..aa9525cff81cb9a64a39509611d81daa5390f942 100644 (file)
@@ -283,10 +283,13 @@ public class TeslaVehicleHandler extends BaseThingHandler {
                             }
                         }
                         if (amps != null) {
-                            if (amps < 5 || amps > 32) {
-                                logger.warn("Charging amps can only be set in a range of 5-32A, but not to {}A.", amps);
+                            if (amps > 32) {
+                                logger.warn("Charging amps cannot be set higher than 32A, {}A was requested", amps);
                                 return;
                             }
+                            if (amps < 5) {
+                                logger.info("Charging amps should be set higher than 5A to avoid excessive losses.");
+                            }
                             setChargingAmps(amps);
                         }
                         break;