From 09ab8c6295cb1c5bdbfdea09b3a21ba4803b8641 Mon Sep 17 00:00:00 2001 From: Vince Chan <15341873+chan-vince@users.noreply.github.com> Date: Fri, 3 Nov 2023 06:58:14 +0000 Subject: [PATCH] Use IdTagInfo datatype instead of Dict for id_tag_info occurances (#278) The `Authorize.conf` message in the v1.6 spec defines what fields should be present for an `IdTagInfo`. The dataclass for this already exists in `datatypes.py`, as of the recently merged #250 PR. This PR makes use of it by importing the dataclass, and using it instead of the more losely typed `typing.Dict`. --- ocpp/v16/call_result.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ocpp/v16/call_result.py b/ocpp/v16/call_result.py index 03deb0553..4e105d33b 100644 --- a/ocpp/v16/call_result.py +++ b/ocpp/v16/call_result.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Dict, List, Optional +from ocpp.v16.datatypes import IdTagInfo from ocpp.v16.enums import ( AvailabilityStatus, CancelReservationStatus, @@ -46,7 +47,7 @@ @dataclass class AuthorizePayload: - id_tag_info: Dict + id_tag_info: IdTagInfo @dataclass @@ -94,7 +95,7 @@ class MeterValuesPayload: @dataclass class StartTransactionPayload: transaction_id: int - id_tag_info: Dict + id_tag_info: IdTagInfo @dataclass @@ -104,7 +105,7 @@ class StatusNotificationPayload: @dataclass class StopTransactionPayload: - id_tag_info: Optional[Dict] = None + id_tag_info: Optional[IdTagInfo] = None # The CALLRESULT messages that flow from Charge Point to Central System are