]> git.basschouten.com Git - openhab-addons.git/commitdiff
[mybmw] add stop charging command (#16937)
authorMartin Grassl <martin.grassl@digital-filestore.de>
Tue, 25 Jun 2024 20:54:13 +0000 (22:54 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jun 2024 20:54:13 +0000 (22:54 +0200)
Signed-off-by: Martin Grassl <martin.grassl@digital-filestore.de>
bundles/org.openhab.binding.mybmw/README.md
bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/MyBMWConstants.java
bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/handler/enums/RemoteService.java
bundles/org.openhab.binding.mybmw/src/test/java/org/openhab/binding/mybmw/internal/dto/VehiclePropertiesTest.java

index c1c1c30e9128fe1706baa907c59085d2c9c80265..6f74d1b64de6a7d0097850b882ae483e9a5fc1f9 100644 (file)
@@ -381,7 +381,8 @@ The channel _command_ provides options
 - _horn-blow_
 - _climate-now-start_
 - _climate-now-stop_
-- _charge-now_
+- _start-charging_
+- _stop-charging_
 
 The channel _state_ shows the progress of the command execution in the following order
 
index 33664482b4e5a92108532157940823327cc48ade..48676b4a3b1a6ab356075c83b10d02c51dc6cfcd 100644 (file)
@@ -220,7 +220,8 @@ public interface MyBMWConstants {
     static final String REMOTE_SERVICE_HORN = "horn-blow";
     static final String REMOTE_SERVICE_AIR_CONDITIONING_START = "climate-now-start";
     static final String REMOTE_SERVICE_AIR_CONDITIONING_STOP = "climate-now-stop";
-    static final String REMOTE_SERVICE_CHARGE = "charge-now";
+    static final String REMOTE_SERVICE_START_CHARGING = "start-charging";
+    static final String REMOTE_SERVICE_STOP_CHARGING = "stop-charging";
 
     static final String REMOTE_SERVICE_COMMAND = "command";
     static final String REMOTE_STATE = "state";
index 2992d460a96c741b0136bfa754641263607f22d0..e64a9eda02240ff50503897dbe03fb3e4dc4eda6 100644 (file)
@@ -14,11 +14,12 @@ package org.openhab.binding.mybmw.internal.handler.enums;
 
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_AIR_CONDITIONING_START;
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_AIR_CONDITIONING_STOP;
-import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_CHARGE;
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_DOOR_LOCK;
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_DOOR_UNLOCK;
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_HORN;
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_LIGHT_FLASH;
+import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_START_CHARGING;
+import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_STOP_CHARGING;
 import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_VEHICLE_FINDER;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -39,7 +40,8 @@ public enum RemoteService {
     HORN_BLOW("Horn Blow", REMOTE_SERVICE_HORN, REMOTE_SERVICE_HORN, ""),
     CLIMATE_NOW_START("Start Climate", REMOTE_SERVICE_AIR_CONDITIONING_START, "climate-now", "{\"action\": \"START\"}"),
     CLIMATE_NOW_STOP("Stop Climate", REMOTE_SERVICE_AIR_CONDITIONING_STOP, "climate-now", "{\"action\": \"STOP\"}"),
-    CHARGE_NOW("Charge", REMOTE_SERVICE_CHARGE, "start-charging", "");
+    START_CHARGING("Start Charging", REMOTE_SERVICE_START_CHARGING, "start-charging", ""),
+    STOP_CHARGING("Stop Charging", REMOTE_SERVICE_STOP_CHARGING, "stop-charging", "");
 
     private final String label;
     private final String id;
index e0422b7fe711947fd91bf39dda6dba2d766693c1..ddf822f2f4ff3b30d808924f3ddf8cd7e5b405e7 100644 (file)
@@ -39,7 +39,7 @@ public class VehiclePropertiesTest {
 
     @Test
     public void testRemoteServiceOptions() {
-        String commandReference = "[CommandOption [command=light-flash, label=Flash Lights], CommandOption [command=vehicle-finder, label=Vehicle Finder], CommandOption [command=door-lock, label=Door Lock], CommandOption [command=door-unlock, label=Door Unlock], CommandOption [command=horn-blow, label=Horn Blow], CommandOption [command=climate-now-start, label=Start Climate], CommandOption [command=climate-now-stop, label=Stop Climate], CommandOption [command=charge-now, label=Charge]]";
+        String commandReference = "[CommandOption [command=light-flash, label=Flash Lights], CommandOption [command=vehicle-finder, label=Vehicle Finder], CommandOption [command=door-lock, label=Door Lock], CommandOption [command=door-unlock, label=Door Unlock], CommandOption [command=horn-blow, label=Horn Blow], CommandOption [command=climate-now-start, label=Start Climate], CommandOption [command=climate-now-stop, label=Stop Climate], CommandOption [command=start-charging, label=Start Charging], CommandOption [command=stop-charging, label=Stop Charging]]";
         List<CommandOption> l = RemoteServiceUtils.getOptions(true);
         assertEquals(commandReference, l.toString(), "Commad Options");
     }