ocpp
ocpp copied to clipboard
v201/Wrong dataclass MeterValueType
MeterValueType was implemented correctly in the JSON schema but the dataclass is implemented incorrectly.
current (wrong):
@dataclass
class MeterValueType:
"""
Collection of one or more sampled values in MeterValuesRequest and
TransactionEvent. All sampled values in a MeterValue are sampled at the
same point in time.
MeterValueType is used by: MeterValuesRequest, TransactionEventRequest
"""
timestamp: str
sampled_value: SampledValueType
should:
@dataclass
class MeterValueType:
"""
Collection of one or more sampled values in MeterValuesRequest and
TransactionEvent. All sampled values in a MeterValue are sampled at the
same point in time.
MeterValueType is used by: MeterValuesRequest, TransactionEventRequest
"""
timestamp: str
sampled_value: List[SampledValueType]
See MeterValueType specification https://raw.githubusercontent.com/mobilityhouse/ocpp/master/docs/v201/OCPP-2.0.1_part2_specification.pdf page 381, sampledValue (1...*)
Thanks for reporting the issue.
I've created a PR for that: https://github.com/mobilityhouse/ocpp/pull/306
This was merged into master some time ago, so I will close this