diff --git a/lib/ocpp/v16/charge_point_impl.cpp b/lib/ocpp/v16/charge_point_impl.cpp index b7f06c545..07fc23f8c 100644 --- a/lib/ocpp/v16/charge_point_impl.cpp +++ b/lib/ocpp/v16/charge_point_impl.cpp @@ -2359,8 +2359,6 @@ void ChargePointImpl::handleGetCompositeScheduleRequest(ocpp::Call call) { EVLOG_debug << "Received ClearChargingProfileRequest: " << call.msg << "\nwith messageId: " << call.uniqueId; - // FIXME(kai): after a profile has been deleted we must notify interested parties (energy manager?) - ClearChargingProfileResponse response; response.status = ClearChargingProfileStatus::Unknown; @@ -2372,9 +2370,9 @@ void ChargePointImpl::handleClearChargingProfileRequest(ocpp::Callsmart_charging_handler->clear_all_profiles_with_filter( call.msg.id, call.msg.connectorId, call.msg.stackLevel, call.msg.chargingProfilePurpose, true)) { response.status = ClearChargingProfileStatus::Accepted; - - } else if (this->smart_charging_handler->clear_all_profiles_with_filter( - call.msg.id, call.msg.connectorId, call.msg.stackLevel, call.msg.chargingProfilePurpose, false)) { + } else if (!call.msg.id and + this->smart_charging_handler->clear_all_profiles_with_filter( + std::nullopt, call.msg.connectorId, call.msg.stackLevel, call.msg.chargingProfilePurpose, false)) { response.status = ClearChargingProfileStatus::Accepted; }