Skip to content

Commit 9d54134

Browse files
authored
Merge branch 'master' into revert_type_hint_change_for_DataTransfer_data
2 parents 862d45e + fab6536 commit 9d54134

File tree

10 files changed

+257
-234
lines changed

10 files changed

+257
-234
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change log
22

3+
- [#447](https://github.com/mobilityhouse/ocpp/issues/447) Make formatting of enums in py3.11 consistent with earlier Python versions
4+
- [#421](https://github.com/mobilityhouse/ocpp/issues/421) Type of v16.datatypes.SampledValue.context is incorrect
5+
6+
## 0.25.0 (2024-01-08)
7+
8+
- [#366](https://github.com/mobilityhouse/ocpp/issues/366) Fix type hint of OCPP 1.6 ChangeConfiguration.value
9+
- [#431](https://github.com/mobilityhouse/ocpp/issues/431) Attributes with 'v2x' are serialized as 'V2x', but should be serialized as 'V2X'
310
- [#554](https://github.com/mobilityhouse/ocpp/issues/554) OCPP 2.0.1 Edition 2 Errata 2023-12 document added
411
- [#548](https://github.com/mobilityhouse/ocpp/issues/548) OCPP 2.0.1 MessageInfoType attribute name correction
512
- [#300](https://github.com/mobilityhouse/ocpp/issues/300) OCPP 2.0.1 add reference components and variables
@@ -8,6 +15,7 @@
815

916
## 0.24.0 (2023-12-07)
1017

18+
1119
- [#539](https://github.com/mobilityhouse/ocpp/issues/539) feat: Add ChargePoint._handle_call return value. Thanks [@wafa-yah](https://github.com/wafa-yah)
1220
- [#266](https://github.com/mobilityhouse/ocpp/issues/266) fix: Central System documentation link.
1321
- [#516](https://github.com/mobilityhouse/ocpp/issues/516) OCPP 2.0.1 add additional security events from v1.3.

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = "Auke Willem Oosterhoff"
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = "0.24.0"
26+
release = "0.25.0"
2727

2828

2929
# -- General configuration ---------------------------------------------------

examples/v201/central_system.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ async def on_connect(websocket, path):
4242
try:
4343
requested_protocols = websocket.request_headers["Sec-WebSocket-Protocol"]
4444
except KeyError:
45-
logging.info("Client hasn't requested any Subprotocol. " "Closing Connection")
46-
return await websocket.close()
4745
logging.error("Client hasn't requested any Subprotocol. Closing Connection")
4846
return await websocket.close()
4947
if websocket.subprotocol:

ocpp/charge_point.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def camel_to_snake_case(data):
4444

4545
def snake_to_camel_case(data):
4646
"""
47-
Convert all keys of a all dictionaries inside given argument from
47+
Convert all keys of all dictionaries inside given argument from
4848
snake_case to camelCase.
4949
5050
Inspired by: https://stackoverflow.com/a/19053800/1073222
@@ -53,6 +53,7 @@ def snake_to_camel_case(data):
5353
camel_case_dict = {}
5454
for key, value in data.items():
5555
key = key.replace("soc", "SoC")
56+
key = key.replace("_v2x", "V2X")
5657
components = key.split("_")
5758
key = components[0] + "".join(x[:1].upper() + x[1:] for x in components[1:])
5859
camel_case_dict[key] = snake_to_camel_case(value)

ocpp/v16/call.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass, field
2-
from typing import Any, Dict, List, Optional
2+
from typing import Dict, List, Optional
33

44
from ocpp.v16.enums import (
55
AvailabilityType,
@@ -55,7 +55,7 @@ class ChangeAvailabilityPayload:
5555
@dataclass
5656
class ChangeConfigurationPayload:
5757
key: str
58-
value: Any
58+
value: str
5959

6060

6161
@dataclass

ocpp/v16/datatypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class SampledValue:
105105
"""
106106

107107
value: str
108-
context: ReadingContext
108+
context: Optional[ReadingContext] = None
109109
format: Optional[ValueFormat] = None
110110
measurand: Optional[Measurand] = None
111111
phase: Optional[Phase] = None

0 commit comments

Comments
 (0)