From 0a3407db00143a8f57dc28fa59b8b17fbeef6b91 Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Tue, 7 Nov 2023 08:18:35 +0100 Subject: [PATCH 1/3] update to match Appendix 2. Standardized Units Of Measure --- CHANGELOG.md | 2 ++ ocpp/v16/enums.py | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 021a35bbd..e672ff369 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Change log +- [#510](https://github.com/mobilityhouse/ocpp/issues/510) v2.0.1 UnitOfMeasureType - Enums missing and update docstring to allow use for variableCharacteristics + ## 0.22.0 (2023-11-03) - [#493](https://github.com/mobilityhouse/ocpp/issues/493) Reduce use of NotSupportedError in favor of NotImplementedError. Thanks [drc38](@https://github.com/drc38). diff --git a/ocpp/v16/enums.py b/ocpp/v16/enums.py index 8071fe17c..cd35bfb62 100644 --- a/ocpp/v16/enums.py +++ b/ocpp/v16/enums.py @@ -773,6 +773,7 @@ class UnitOfMeasure(str, Enum): k = "K" percent = "Percent" hertz = "Hertz" + b = "Bytes" class UnlockStatus(str, Enum): From 3f5ed5a62fdf89d8ab2dd726554f893e378ec18c Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Tue, 7 Nov 2023 08:25:36 +0100 Subject: [PATCH 2/3] update doc string to include variableCharacteristics --- ocpp/v16/enums.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ocpp/v16/enums.py b/ocpp/v16/enums.py index cd35bfb62..c91fe9b79 100644 --- a/ocpp/v16/enums.py +++ b/ocpp/v16/enums.py @@ -753,7 +753,8 @@ class UnitOfMeasure(str, Enum): """ Allowable values of the optional "unit" field of a Value element, as used in MeterValues.req and StopTransaction.req messages. Default value of - "unit" is always "Wh". + "unit" is always "Wh". Also used in 2.0.1 component/variables - + specifically the unit in variableCharacteristics. """ wh = "Wh" From 5fc65c4c00684eec8ffb7627f51b1b20a0636021 Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Tue, 7 Nov 2023 09:08:01 +0100 Subject: [PATCH 3/3] correction to v201 --- ocpp/v16/enums.py | 4 +--- ocpp/v201/enums.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ocpp/v16/enums.py b/ocpp/v16/enums.py index c91fe9b79..8071fe17c 100644 --- a/ocpp/v16/enums.py +++ b/ocpp/v16/enums.py @@ -753,8 +753,7 @@ class UnitOfMeasure(str, Enum): """ Allowable values of the optional "unit" field of a Value element, as used in MeterValues.req and StopTransaction.req messages. Default value of - "unit" is always "Wh". Also used in 2.0.1 component/variables - - specifically the unit in variableCharacteristics. + "unit" is always "Wh". """ wh = "Wh" @@ -774,7 +773,6 @@ class UnitOfMeasure(str, Enum): k = "K" percent = "Percent" hertz = "Hertz" - b = "Bytes" class UnlockStatus(str, Enum): diff --git a/ocpp/v201/enums.py b/ocpp/v201/enums.py index 30b12a756..50503d60f 100644 --- a/ocpp/v201/enums.py +++ b/ocpp/v201/enums.py @@ -1244,7 +1244,8 @@ class UnitOfMeasureType(str, Enum): """ Allowable values of the optional "unit" field of a Value element, as used in MeterValues.req and StopTransaction.req messages. Default value of - "unit" is always "Wh". + "unit" is always "Wh". Also used in component/variables - + specifically the unit in variableCharacteristics. """ asu = "ASU"