bugfixes/improvements (#14637)

Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
alexf2015 2023-03-19 16:02:33 +01:00 committed by GitHub
parent 4e4385e261
commit aee57afb0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 4 deletions

View File

@ -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 | | |

View File

@ -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";

View File

@ -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(),

View File

@ -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));
}
}