Skip to content

Commit 15de0ac

Browse files
committed
Remove charging profile regardless of reply status #963
In case the charge point doesn't known the charging profile that should be cleared, it might be already done. So remove the profile regardless of the reply status from the repository to be in sync.
1 parent 3afccbc commit 15de0ac

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,16 @@ public OcppCallback<String> defaultCallback() {
5252
public void success(String chargeBoxId, String statusValue) {
5353
addNewResponse(chargeBoxId, statusValue);
5454

55-
if ("Accepted".equalsIgnoreCase(statusValue)) {
56-
switch (params.getFilterType()) {
57-
case ChargingProfileId:
58-
chargingProfileRepository.clearProfile(params.getChargingProfilePk(), chargeBoxId);
59-
break;
60-
case OtherParameters:
61-
chargingProfileRepository.clearProfile(chargeBoxId,
62-
params.getConnectorId(), params.getChargingProfilePurpose(), params.getStackLevel());
63-
break;
64-
default:
65-
log.warn("Unexpected {} enum value", ClearChargingProfileFilterType.class.getSimpleName());
66-
}
55+
switch (params.getFilterType()) {
56+
case ChargingProfileId:
57+
chargingProfileRepository.clearProfile(params.getChargingProfilePk(), chargeBoxId);
58+
break;
59+
case OtherParameters:
60+
chargingProfileRepository.clearProfile(chargeBoxId,
61+
params.getConnectorId(), params.getChargingProfilePurpose(), params.getStackLevel());
62+
break;
63+
default:
64+
log.warn("Unexpected {} enum value", ClearChargingProfileFilterType.class.getSimpleName());
6765
}
6866
}
6967
};

0 commit comments

Comments
 (0)