From 7e3e242cc351628d51b7181ade4e8e4def18c896 Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Mon, 5 Feb 2024 13:28:31 +0100 Subject: [PATCH] Revert "v2x corrected" This reverts commit 81e8e64cbebfd6294b05521aee684250d0b9db00. --- CHANGELOG.md | 1 - ocpp/charge_point.py | 1 - tests/test_charge_point.py | 2 -- 3 files changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5c238d1..e05bb06d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ # Change log - [#583](https://github.com/mobilityhouse/ocpp/issues/583) OCPP v1.6/v2.0.1 deprecate dataclasses from calls and call results with the suffix 'Payload' -- [#591](https://github.com/mobilityhouse/ocpp/issues/591) Camel_to_snake_case doesn't handle v2x correctly ## 0.26.0 (2024-01-17) diff --git a/ocpp/charge_point.py b/ocpp/charge_point.py index e23fbf50d..4d7cb9676 100644 --- a/ocpp/charge_point.py +++ b/ocpp/charge_point.py @@ -25,7 +25,6 @@ def camel_to_snake_case(data): if isinstance(data, dict): snake_case_dict = {} for key, value in data.items(): - key = key.replace("V2X", "_v2x") s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", key) key = re.sub("([a-z0-9])([A-Z])(?=\\S)", r"\1_\2", s1).lower() diff --git a/tests/test_charge_point.py b/tests/test_charge_point.py index e8d71c3fd..897fabc2b 100644 --- a/tests/test_charge_point.py +++ b/tests/test_charge_point.py @@ -58,8 +58,6 @@ def heartbeat(self, **kwargs): [ ({"transactionId": "74563478"}, {"transaction_id": "74563478"}), ({"fullSoC": 100}, {"full_soc": 100}), - ({"evMinV2XEnergyRequest": 200}, {"ev_min_v2x_energy_request": 200}), - ({"v2xChargingCtrlr": 200}, {"v2x_charging_ctrlr": 200}), ], ) def test_camel_to_snake_case(test_input, expected):