fix #14898 caused by easee API changes (#14903)

Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
alexf2015 2023-04-29 14:55:27 +02:00 committed by GitHub
parent 6a33668664
commit 4fa92b8c98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -60,7 +60,7 @@ The settings that start with "dynamic" can be changed frequently, the others are
|---------------------------------------------|--------------------------|----------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| state#smartCharging | Switch | no | | |
| state#cableLocked | Switch | no | | |
| state#chargerOpMode | Number | no | 0=Offline, 1=Disconnected, 2=AwaitingStart, 3=Charging, 4=Completed, 5=Error, 6=ReadyToCharge | |
| state#chargerOpMode | Number | no | 0=Offline, 1=Disconnected, 2=AwaitingStart, 3=Charging, 4=Completed, 5=Error, 6=ReadyToCharge, 7=AwaitingAuthentication, 8=Deauthenticating | |
| state#totalPower | Number:Power | no | current session total power (all phases) | |
| state#sessionEnergy | Number:Energy | no | current session | |
| state#dynamicCircuitCurrentP1 | Number:ElectricCurrent | no | | |
@ -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 | 2=NoCurrent, 27=Charging, 52=Paused, 55=NotAuthorized, 79=BatteryFull | |
| state#reasonForNoCurrent | Number | no | 0=OK, 2=DynamicCircuitCurrentLimitTooLow, 27=DynamicCircuitCurrentCharging, 52=DynamicChargerCurrentLimitTooLow, 55=NotAuthorized, 79=CarLimit, 81=CarLimitedCharging | |
| state#lifetimeEnergy | Number:Energy | no | | |
| state#errorCode | Number | no | | |
| state#fatalErrorCode | Number | no | | |

View File

@ -151,9 +151,10 @@ public class EaseeBindingConstants {
public static final String GENERIC_NO = "No";
public static final int CHARGER_OP_STATE_WAITING = 2;
public static final int CHARGER_OP_STATE_CHARGING = 3;
public static final int CHARGER_OP_STATE_NOT_AUTHENTICATED = 7;
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 int CHARGER_REASON_FOR_NO_CURRENT_CIRCUIT_LIMIT = 2;
public static final int CHARGER_REASON_FOR_NO_CURRENT_CHARGER_LIMIT = 52;
public static final String THING_CONFIG_ID = "id";
public static final String THING_CONFIG_SITE_ID = "siteId";

View File

@ -82,16 +82,16 @@ class CustomResponseTransformer {
Channel channel = channelProvider.getChannel(CHANNEL_GROUP_CHARGER_COMMANDS, CHANNEL_CHARGER_START_STOP);
if (channel != null) {
int val = Integer.parseInt(value);
// state >= 3 will mean charging, ready to charge or charging finished
boolean charging = val >= CHARGER_OP_STATE_CHARGING;
// state >= 3 && state < 7 will mean charging, ready to charge or charging finished
boolean charging = val >= CHARGER_OP_STATE_CHARGING && val < CHARGER_OP_STATE_NOT_AUTHENTICATED;
String rfnc = Utils.getAsString(rawData, CHANNEL_CHARGER_REASON_FOR_NO_CURRENT);
int reasonForNoCurrent = Integer.valueOf(rfnc == null ? "-1" : rfnc);
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:
case CHARGER_REASON_FOR_NO_CURRENT_CHARGER_LIMIT:
case CHARGER_REASON_FOR_NO_CURRENT_CIRCUIT_LIMIT:
paused = true;
break;
default: