Closed OrangeTux closed 2 months ago
ocpp.charge_point.serialize_as_dict() wrongly serializes a payload that contains a collection of multiple items. The following payload contains a collection of 2 SetVariableResultType. But the serializes output contains only a single item.
ocpp.charge_point.serialize_as_dict()
SetVariableResultType
Thanks @OSkrk for making me aware of this issue.
Consider this payload:
payload = call_result.SetVariables( set_variable_result=[ datatypes.SetVariableResultType( attribute_status=enums.SetVariableStatusType.accepted, component={ "name": "TemperatureSensor", "instance": "First", "evse": {"id": 1, "connector_id": 1}, }, variable={"name": "DisplayUnit", "instance": "Main"}, attribute_type="Actual", attribute_status_info=None, ), datatypes.SetVariableResultType( attribute_status="Accepted", component={"name": "TxCtrlr"}, variable={"name": "TxStopPoint"}, attribute_type="Actual", attribute_status_info=None, ), ], custom_data=None, )
It's serialized as this:
'set_variable_result': [{'attribute_status': 'Accepted', 'attribute_status_info': None, 'attribute_type': 'Actual', 'component': {'name': 'TxCtrlr'}, 'variable': {'name': 'TxStopPoint'}}],
ocpp.charge_point.serialize_as_dict()
wrongly serializes a payload that contains a collection of multiple items. The following payload contains a collection of 2SetVariableResultType
. But the serializes output contains only a single item.Thanks @OSkrk for making me aware of this issue.
Consider this payload:
It's serialized as this: