Skip to content

Commit 64eb956

Browse files
committed
Don't store TxProfiles in repository #367
Instead of keeping track which TxProfile belongs to which transaction, exclude the temporary TxProfiles from the profile repository completely.
1 parent 15de0ac commit 64eb956

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/de/rwth/idsg/steve/ocpp/task/SetChargingProfileTask.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ public OcppCallback<String> defaultCallback() {
5757
return new DefaultOcppCallback<String>() {
5858
@Override
5959
public void success(String chargeBoxId, String statusValue) {
60+
ChargingProfilePurposeType purpose = ChargingProfilePurposeType.fromValue(params.getDetails().getProfile().getChargingProfilePurpose());
6061
addNewResponse(chargeBoxId, statusValue);
6162

62-
if ("Accepted".equalsIgnoreCase(statusValue)) {
63+
if ("Accepted".equalsIgnoreCase(statusValue) && ChargingProfilePurposeType.TX_PROFILE != purpose) {
6364
int chargingProfilePk = params.getDetails().getProfile().getChargingProfilePk();
6465
int connectorId = params.getDelegate().getConnectorId();
66+
6567
chargingProfileRepository.setProfile(chargingProfilePk, chargeBoxId, connectorId);
6668
}
6769
}

0 commit comments

Comments
 (0)