2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.easee.internal.command.charger;
15 import static org.openhab.binding.easee.internal.EaseeBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.easee.internal.command.JsonResultProcessor;
19 import org.openhab.binding.easee.internal.handler.EaseeThingHandler;
20 import org.openhab.core.library.types.OnOffType;
21 import org.openhab.core.thing.Channel;
22 import org.openhab.core.types.Command;
25 * implements the command api call of the charger.
27 * @author Alexander Friese - initial contribution
30 public class SendCommandPauseResume extends SendCommand {
32 public SendCommandPauseResume(EaseeThingHandler handler, String chargerId, Channel channel, Command command,
33 JsonResultProcessor resultProcessor) {
34 super(handler, channel, command, resultProcessor);
36 if (command.equals(OnOffType.ON)) {
37 value = CMD_VAL_PAUSE_CHARGING;
39 value = CMD_VAL_RESUME_CHARGING;
41 this.url = COMMANDS_URL.replaceAll("\\{id\\}", chargerId).replaceAll("\\{command\\}", value);