Skip to content

Commit

Permalink
Merge branch 'master' into Attributes-with-'v2x'-are-serialized-as-'V…
Browse files Browse the repository at this point in the history
…2x',-but-should-be-serialized-as-'V2X'
  • Loading branch information
OrangeTux authored Jan 9, 2024
2 parents 9ce42b9 + efbcb17 commit f69c915
Show file tree
Hide file tree
Showing 12 changed files with 1,425 additions and 14 deletions.
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Change log

- [#431](https://github.com/mobilityhouse/ocpp/issues/431) Attributes with 'v2x' are serialized as 'V2x', but should be serialized as 'V2X'
- [#510](https://github.com/mobilityhouse/ocpp/issues/510) v2.0.1 UnitOfMeasureType - Enums missing and update docstring to allow use for variableCharacteristics
- [#508](https://github.com/mobilityhouse/ocpp/issues/508) Exception - OccurrenceConstraintViolationError doc string correction
- [#554](https://github.com/mobilityhouse/ocpp/issues/554) OCPP 2.0.1 Edition 2 Errata 2023-12 document added
- [#548](https://github.com/mobilityhouse/ocpp/issues/548) OCPP 2.0.1 MessageInfoType attribute name correction
- [#300](https://github.com/mobilityhouse/ocpp/issues/300) OCPP 2.0.1 add reference components and variables
- [#518](https://github.com/mobilityhouse/ocpp/issues/518) OCPP 2.0.1 add additional reason codes from v1.3

## 0.24.0 (2023-12-07)

- [#539](https://github.com/mobilityhouse/ocpp/issues/539) feat: Add ChargePoint._handle_call return value. Thanks [@wafa-yah](https://github.com/wafa-yah)
- [#266](https://github.com/mobilityhouse/ocpp/issues/266) fix: Central System documentation link.
- [#516](https://github.com/mobilityhouse/ocpp/issues/516) OCPP 2.0.1 add additional security events from v1.3.
- [#537](https://github.com/mobilityhouse/ocpp/pull/537) Fix DataTransfer data types. Thanks [@mdwcrft](https://github.com/mdwcrft)

## 0.23.0 (2023-11-30)

- [#531] Feat: Add 1.6 security extension datatypes. Thanks [@proelke](https://github.com/proelke)
- [#528](https://github.com/mobilityhouse/ocpp/issues/528) v2.0.1 CertificateHashDataChainType childCertificateHashData requires the default of None.
- [#510](https://github.com/mobilityhouse/ocpp/issues/510) v2.0.1 UnitOfMeasureType - Enums missing and update docstring to allow use for variableCharacteristics.
- [#508](https://github.com/mobilityhouse/ocpp/issues/508) Exception - OccurrenceConstraintViolationError doc string correction.

## 0.22.0 (2023-11-03)

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Central system

The code snippet below creates a simple OCPP 2.0 central system which is able
to handle BootNotification calls. You can find a detailed explanation of the
code in the `Central System documentation_`.
code in the `Central System documentation`_.


.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Auke Willem Oosterhoff"

# The full version, including alpha/beta/rc tags
release = "0.22.0"
release = "0.24.0"


# -- General configuration ---------------------------------------------------
Expand Down
Binary file added docs/v201/OCPP-2.0.1_edition2_errata_2023-12.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions examples/v201/central_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ async def on_connect(websocket, path):
try:
requested_protocols = websocket.request_headers["Sec-WebSocket-Protocol"]
except KeyError:
logging.info("Client hasn't requested any Subprotocol. " "Closing Connection")
return await websocket.close()
logging.error("Client hasn't requested any Subprotocol. Closing Connection")
return await websocket.close()
if websocket.subprotocol:
Expand Down
1 change: 1 addition & 0 deletions ocpp/charge_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ async def _handle_call(self, msg):
# '_on_after' hooks are not required. Therefore ignore exception
# when no '_on_after' hook is installed.
pass
return response

async def call(self, payload, suppress=True, unique_id=None):
"""
Expand Down
43 changes: 43 additions & 0 deletions ocpp/v16/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ChargingProfilePurposeType,
ChargingRateUnitType,
CiStringType,
HashAlgorithm,
Location,
Measurand,
Phase,
Expand Down Expand Up @@ -121,3 +122,45 @@ class MeterValue:

timestamp: str
sampled_value: List[SampledValue]


# Security Extension


@dataclass
class CertificateHashData:
"""
CertificateHashDataType is used by:
DeleteCertificate.req, GetInstalledCertificateIds.conf
"""

hash_algorithm: HashAlgorithm
issuer_name_hash: str
issuer_key_hash: str
serial_number: str


@dataclass
class Firmware:
"""
Represents a copy of the firmware that can be loaded/updated on the Charge Point.
FirmwareType is used by: SignedUpdateFirmware.req
"""

location: str
retrieve_date_time: str
signing_certificate: str
install_date_time: Optional[str] = None
signature: Optional[str] = None


@dataclass
class LogParameters:
"""
Class for detailed information the retrieval of logging entries.
LogParametersType is used by: GetLog.req
"""

remote_location: str
oldest_timestamp: Optional[str] = None
latest_timestamp: Optional[str] = None
2 changes: 1 addition & 1 deletion ocpp/v201/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CustomerInformationPayload:
class DataTransferPayload:
vendor_id: str
message_id: Optional[str] = None
data: Optional[str] = None
data: Optional[Any] = None
custom_data: Optional[Dict[str, Any]] = None


Expand Down
2 changes: 1 addition & 1 deletion ocpp/v201/call_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CustomerInformationPayload:
class DataTransferPayload:
status: str
status_info: Optional[Dict] = None
data: Optional[Dict] = None
data: Optional[Any] = None
custom_data: Optional[Dict[str, Any]] = None


Expand Down
4 changes: 2 additions & 2 deletions ocpp/v201/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CertificateHashDataChainType:

certificate_type: enums.GetCertificateIdUseType
certificate_hash_data: CertificateHashDataType
child_certificate_hash_data: Optional[List[CertificateHashDataType]]
child_certificate_hash_data: Optional[List[CertificateHashDataType]] = None


@dataclass
Expand Down Expand Up @@ -530,7 +530,7 @@ class MessageInfoType:
message: MessageContentType
state: Optional[enums.MessageStateType] = None
start_date_time: Optional[str] = None
end_data_time: Optional[str] = None
end_date_time: Optional[str] = None
transaction_id: Optional[str] = None
display: Optional[ComponentType] = None

Expand Down
Loading

0 comments on commit f69c915

Please sign in to comment.