Skip to content

Commit 9744090

Browse files
authored
[mybmw] add stop charging command (openhab#16937)
Signed-off-by: Martin Grassl <[email protected]>
1 parent 44b0c52 commit 9744090

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

bundles/org.openhab.binding.mybmw/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ The channel _command_ provides options
381381
- _horn-blow_
382382
- _climate-now-start_
383383
- _climate-now-stop_
384-
- _charge-now_
384+
- _start-charging_
385+
- _stop-charging_
385386

386387
The channel _state_ shows the progress of the command execution in the following order
387388

bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/MyBMWConstants.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ enum ChargingPreference {
220220
static final String REMOTE_SERVICE_HORN = "horn-blow";
221221
static final String REMOTE_SERVICE_AIR_CONDITIONING_START = "climate-now-start";
222222
static final String REMOTE_SERVICE_AIR_CONDITIONING_STOP = "climate-now-stop";
223-
static final String REMOTE_SERVICE_CHARGE = "charge-now";
223+
static final String REMOTE_SERVICE_START_CHARGING = "start-charging";
224+
static final String REMOTE_SERVICE_STOP_CHARGING = "stop-charging";
224225

225226
static final String REMOTE_SERVICE_COMMAND = "command";
226227
static final String REMOTE_STATE = "state";

bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/handler/enums/RemoteService.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414

1515
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_AIR_CONDITIONING_START;
1616
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_AIR_CONDITIONING_STOP;
17-
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_CHARGE;
1817
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_DOOR_LOCK;
1918
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_DOOR_UNLOCK;
2019
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_HORN;
2120
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_LIGHT_FLASH;
21+
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_START_CHARGING;
22+
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_STOP_CHARGING;
2223
import static org.openhab.binding.mybmw.internal.MyBMWConstants.REMOTE_SERVICE_VEHICLE_FINDER;
2324

2425
import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -39,7 +40,8 @@ public enum RemoteService {
3940
HORN_BLOW("Horn Blow", REMOTE_SERVICE_HORN, REMOTE_SERVICE_HORN, ""),
4041
CLIMATE_NOW_START("Start Climate", REMOTE_SERVICE_AIR_CONDITIONING_START, "climate-now", "{\"action\": \"START\"}"),
4142
CLIMATE_NOW_STOP("Stop Climate", REMOTE_SERVICE_AIR_CONDITIONING_STOP, "climate-now", "{\"action\": \"STOP\"}"),
42-
CHARGE_NOW("Charge", REMOTE_SERVICE_CHARGE, "start-charging", "");
43+
START_CHARGING("Start Charging", REMOTE_SERVICE_START_CHARGING, "start-charging", ""),
44+
STOP_CHARGING("Stop Charging", REMOTE_SERVICE_STOP_CHARGING, "stop-charging", "");
4345

4446
private final String label;
4547
private final String id;

bundles/org.openhab.binding.mybmw/src/test/java/org/openhab/binding/mybmw/internal/dto/VehiclePropertiesTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void testChannelUID() {
3939

4040
@Test
4141
public void testRemoteServiceOptions() {
42-
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]]";
42+
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]]";
4343
List<CommandOption> l = RemoteServiceUtils.getOptions(true);
4444
assertEquals(commandReference, l.toString(), "Commad Options");
4545
}

0 commit comments

Comments
 (0)