From d6dd017bbc505539475a4dd4d4b63ddf3d857110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piet=20G=C3=B6mpel?= Date: Mon, 23 Dec 2024 12:05:25 +0100 Subject: [PATCH] Checking supported_feature_profiles for CostAndPrice before attepting to get respective conigutation keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piet Gömpel --- lib/ocpp/v16/charge_point_configuration.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ocpp/v16/charge_point_configuration.cpp b/lib/ocpp/v16/charge_point_configuration.cpp index dee32eaa7..4418e6251 100644 --- a/lib/ocpp/v16/charge_point_configuration.cpp +++ b/lib/ocpp/v16/charge_point_configuration.cpp @@ -3289,12 +3289,12 @@ std::optional ChargePointConfiguration::get(CiString<50> key) { } } - // California Pricing - if (key == "CustomDisplayCostAndPrice") { - return this->getCustomDisplayCostAndPriceEnabledKeyValue(); - } + if (this->supported_feature_profiles.count(SupportedFeatureProfiles::CostAndPrice)) { + // California Pricing + if (key == "CustomDisplayCostAndPrice") { + return this->getCustomDisplayCostAndPriceEnabledKeyValue(); + } - if (getCustomDisplayCostAndPriceEnabled()) { if (key == "NumberOfDecimalsForCostValues") { return this->getPriceNumberOfDecimalsForCostValuesKeyValue(); }