mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
bugfixes/improvements (#14637)
Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
parent
4e4385e261
commit
aee57afb0e
@ -73,7 +73,7 @@ The settings that start with "dynamic" can be changed frequently, the others are
|
||||
| state#outputCurrent | Number:ElectricCurrent | no | | |
|
||||
| state#isOnline | Switch | no | | |
|
||||
| state#dynamicChargerCurrent | Number:ElectricCurrent | yes | | 0, 6-32 |
|
||||
| state#reasonForNoCurrent | Number | no | | |
|
||||
| state#reasonForNoCurrent | Number | no | 2=NoCurrent, 27=Charging, 52=Paused, 55=NotAuthorized, 79=BatteryFull | |
|
||||
| state#lifetimeEnergy | Number:Energy | no | | |
|
||||
| state#errorCode | Number | no | | |
|
||||
| state#fatalErrorCode | Number | no | | |
|
||||
|
@ -104,6 +104,7 @@ public class EaseeBindingConstants {
|
||||
public static final String COMMAND_CHANGE_CONFIGURATION = "ChangeConfiguration";
|
||||
public static final String COMMAND_SEND_COMMAND = "SendCommand";
|
||||
public static final String COMMAND_SEND_COMMAND_START_STOP = "SendCommandStartStop";
|
||||
public static final String COMMAND_SEND_COMMAND_PAUSE_RESUME = "SendCommandPauseResume";
|
||||
public static final String COMMAND_SET_CIRCUIT_SETTINGS = "SetCircuitSettings";
|
||||
public static final String COMMAND_SET_DYNAMIC_CIRCUIT_CURRENTS = "SetDynamicCircuitCurrents";
|
||||
public static final String COMMAND_SET_MAX_CIRCUIT_CURRENTS = "SetMaxCircuitCurrents";
|
||||
@ -151,6 +152,7 @@ public class EaseeBindingConstants {
|
||||
public static final int CHARGER_OP_STATE_WAITING = 2;
|
||||
public static final int CHARGER_OP_STATE_CHARGING = 3;
|
||||
public static final double CHARGER_DYNAMIC_CURRENT_PAUSE = 0;
|
||||
public static final int CHARGER_REASON_FOR_NO_CURRENT_DYNAMIC_0KW = 2;
|
||||
public static final int CHARGER_REASON_FOR_NO_CURRENT_PAUSED = 52;
|
||||
|
||||
public static final String THING_CONFIG_ID = "id";
|
||||
|
@ -31,6 +31,7 @@ import org.openhab.binding.easee.internal.command.charger.ChargerState;
|
||||
import org.openhab.binding.easee.internal.command.charger.GetConfiguration;
|
||||
import org.openhab.binding.easee.internal.command.charger.LatestChargingSession;
|
||||
import org.openhab.binding.easee.internal.command.charger.SendCommand;
|
||||
import org.openhab.binding.easee.internal.command.charger.SendCommandPauseResume;
|
||||
import org.openhab.binding.easee.internal.command.charger.SendCommandStartStop;
|
||||
import org.openhab.binding.easee.internal.config.EaseeConfiguration;
|
||||
import org.openhab.binding.easee.internal.connector.CommunicationStatus;
|
||||
@ -218,6 +219,8 @@ public class EaseeChargerHandler extends BaseThingHandler implements EaseeThingH
|
||||
return new SendCommand(this, chargerId, channel, command);
|
||||
case COMMAND_SEND_COMMAND_START_STOP:
|
||||
return new SendCommandStartStop(this, chargerId, channel, command);
|
||||
case COMMAND_SEND_COMMAND_PAUSE_RESUME:
|
||||
return new SendCommandPauseResume(this, chargerId, channel, command);
|
||||
default:
|
||||
// this should not happen
|
||||
logger.error("write command '{}' not found for channel '{}'", command.toString(),
|
||||
|
@ -87,9 +87,18 @@ class CustomResponseTransformer {
|
||||
|
||||
String rfnc = Utils.getAsString(rawData, CHANNEL_CHARGER_REASON_FOR_NO_CURRENT);
|
||||
int reasonForNoCurrent = Integer.valueOf(rfnc == null ? "-1" : rfnc);
|
||||
boolean paused = (val == CHARGER_OP_STATE_WAITING
|
||||
&& reasonForNoCurrent == CHARGER_REASON_FOR_NO_CURRENT_PAUSED);
|
||||
|
||||
boolean paused = false;
|
||||
if (val == CHARGER_OP_STATE_WAITING) {
|
||||
switch (reasonForNoCurrent) {
|
||||
case CHARGER_REASON_FOR_NO_CURRENT_PAUSED:
|
||||
case CHARGER_REASON_FOR_NO_CURRENT_DYNAMIC_0KW:
|
||||
paused = true;
|
||||
break;
|
||||
default:
|
||||
paused = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result.put(channel, OnOffType.from(charging || paused));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user