Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifiying any payload dataclass #624

Open
arahman33 opened this issue Apr 8, 2024 · 1 comment
Open

Modifiying any payload dataclass #624

arahman33 opened this issue Apr 8, 2024 · 1 comment

Comments

@arahman33
Copy link

Hi,

I am currently trying to test whether more arguments can be added to the already built payloads, for example, adding transaction_id in RequestStartTransactionPayload. Part of the reason I am trying to add this is because other available implementations of ocpp2.0.1 do include these fields. My initial attempts include adding the transaction_id in the class definition of the payload as follows:

@DataClass
class RequestStartTransactionPayload:
id_token: Dict
remote_start_id: int
evse_id: Optional[int] = None
group_id_token: Optional[Dict] = None
charging_profile: Optional[Dict] = None
custom_data: Optional[Dict[str, Any]] = None
transaction_id: str

I have bolded what I added into the class definition. However, when I try to run this, it gives me the following error:

request = call.RequestStartTransactionPayload(
TypeError: RequestStartTransactionPayload.init() got an unexpected keyword argument 'transaction_id'

What other files should be edited in order to make the test successful?

@jainmohit2001
Copy link
Collaborator

HI @arahman33, were you able to solve this issue?

At first glance, I believe the custom_data field is what you need. Please look up OCPP-2.0.1_edition3_part4_ocpp-j-specification: Section 9: CustomData Extension for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants