From 1b2907e04c749eed40b324fd86720e7717cd56b6 Mon Sep 17 00:00:00 2001 From: pietfried Date: Wed, 17 Apr 2024 14:44:43 +0200 Subject: [PATCH 1/2] Removed setting of ChargePointConfigPath for OCPP201 during fixture setup Signed-off-by: pietfried --- .../ocpp_module_configuration_strategy.py | 2 +- .../everest_environment_setup.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/everest-testing/src/everest/testing/core_utils/_configuration/everest_configuration_strategies/ocpp_module_configuration_strategy.py b/everest-testing/src/everest/testing/core_utils/_configuration/everest_configuration_strategies/ocpp_module_configuration_strategy.py index 7d05f53a..6c731815 100644 --- a/everest-testing/src/everest/testing/core_utils/_configuration/everest_configuration_strategies/ocpp_module_configuration_strategy.py +++ b/everest-testing/src/everest/testing/core_utils/_configuration/everest_configuration_strategies/ocpp_module_configuration_strategy.py @@ -9,11 +9,11 @@ @dataclass class OCPPModuleConfigurationBase: - ChargePointConfigPath: str MessageLogPath: str @dataclass class OCPPModulePaths16(OCPPModuleConfigurationBase): + ChargePointConfigPath: str UserConfigPath: str DatabasePath: str diff --git a/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py b/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py index 11aa5375..64a9b3e6 100644 --- a/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py +++ b/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py @@ -173,7 +173,6 @@ def _create_ocpp_module_configuration_strategy(self, ) elif self._ocpp_config.ocpp_version == OCPPVersion.ocpp201: ocpp_paths = OCPPModulePaths201( - ChargePointConfigPath=str(temporary_paths.ocpp_config_file), MessageLogPath=str(temporary_paths.ocpp_message_log_directory), CoreDatabasePath=str(temporary_paths.ocpp_database_dir), DeviceModelDatabasePath=str(temporary_paths.ocpp_database_dir / "device_model_storage.db"), @@ -193,8 +192,12 @@ def _setup_libocpp_configuration(self, temporary_paths: _EverestEnvironmentTempo if self._ocpp_config.template_ocpp_config: source_ocpp_config = self._ocpp_config.template_ocpp_config - else: + elif self._ocpp_config.ocpp_version == OCPPVersion.ocpp16: source_ocpp_config = self._determine_configured_charge_point_config_path_from_everest_config() + elif self._ocpp_config.ocpp_version == OCPPVersion.ocpp201: + ocpp_dir = self._everest_core.prefix_path / "share/everest/modules/OCPP201" + source_ocpp_config = ocpp_dir / "config.json" + liboccp_configuration_helper.generate_ocpp_config( central_system_port=self._ocpp_config.central_system_port, @@ -243,18 +246,16 @@ def _create_everest_configuration_strategies(self, temporary_paths: _EverestEnvi def _determine_configured_charge_point_config_path_from_everest_config(self): - everest_template_config = yaml.safe_load(self._core_config.template_everest_config_path.read_text()) + if self._ocpp_config.ocpp_version == OCPPVersion.ocpp16: + everest_template_config = yaml.safe_load(self._core_config.template_everest_config_path.read_text()) - charge_point_config_path = \ - everest_template_config["active_modules"][self._ocpp_config.ocpp_module_id]["config_module"][ + charge_point_config_path = \ + everest_template_config["active_modules"][self._ocpp_config.ocpp_module_id]["config_module"][ "ChargePointConfigPath"] - if self._ocpp_config.ocpp_version == OCPPVersion.ocpp16: ocpp_dir = self._everest_core.prefix_path / "share/everest/modules/OCPP" - elif self._ocpp_config.ocpp_version == OCPPVersion.ocpp201: - ocpp_dir = self._everest_core.prefix_path / "share/everest/modules/OCPP201" else: - raise ValueError(f"unknown OCPP version {self._ocpp_config.ocpp_version}") + raise ValueError(f"Could not determine ChargePointConfigPath for OCPP version {self._ocpp_config.ocpp_version}") ocpp_config_path = ocpp_dir / charge_point_config_path return ocpp_config_path From 3d5590acde3dcb5eff10e9e9604f04a5881eebfd Mon Sep 17 00:00:00 2001 From: pietfried Date: Wed, 17 Apr 2024 14:45:15 +0200 Subject: [PATCH 2/2] bump version Signed-off-by: pietfried --- everest-testing/src/everest/testing/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/everest-testing/src/everest/testing/__init__.py b/everest-testing/src/everest/testing/__init__.py index d6997024..414ffe99 100644 --- a/everest-testing/src/everest/testing/__init__.py +++ b/everest-testing/src/everest/testing/__init__.py @@ -1 +1 @@ -__version__="0.2.2" +__version__="0.2.3"