ocpp icon indicating copy to clipboard operation
ocpp copied to clipboard

Bug: in data class definitions for connector_id (not as per specification)

Open no-veternarian23 opened this issue 1 year ago • 1 comments

I am not sure if this is a bug, also my python knowledge is a little weak (i am mostly a Java programmer). But i noticed that all the dataclass definitions in the call.py file has incorrectly named the field connectorId as connector_id which is not as per the specification (this is for v16).

And this is causing issues when building the payload objects using these data classes. For example when i am calling the below code, the code itself works. But since this is not as per the specification, when testing with a live charging station, this is failing.

cpRequestPayload = call.TriggerMessagePayload(requested_message="TriggerMessage",connector_id=1)
    
    cpRequest = Call(
        unique_id=str(uuid.uuid4()),
        action=cpRequestPayload.__class__.__name__[:-7],
        payload=cpRequestPayload
    )

Since i couldn't find anyone raising an issue over this, i am guessing im doing something wrong OR is it that my charging station is not designed correctly?

no-veternarian23 avatar Feb 25 '24 07:02 no-veternarian23

@no-veternarian23

I don't think this is a bug. In CP, the naming convention changes from camel case to snake case at this point . Therefore, when writing CP code, you essentially write in snake_case.

Yoshida-Taisei avatar Mar 19 '24 02:03 Yoshida-Taisei

Thanks, missed that.

no-veternarian23 avatar Apr 03 '24 15:04 no-veternarian23