Skip to content

Commit 4dce8c0

Browse files
committed
fix linting
1 parent 344c0c3 commit 4dce8c0

File tree

1 file changed

+111
-32
lines changed

1 file changed

+111
-32
lines changed

ocpp/v201/datatypes.py

+111-32
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from dataclasses import dataclass
22
from datetime import datetime
3-
from io import StringIO
43
from typing import Optional
54

65
from ocpp.v201 import enums
@@ -22,7 +21,8 @@ class ACChargingParametersType:
2221
@dataclass
2322
class AdditionalInfoType:
2423
"""
25-
Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
24+
Contains a case insensitive identifier to use for the authorization and the
25+
type of authorization to support multiple forms of identifiers.
2626
AdditionalInfoType is used by: IdTokenType
2727
"""
2828

@@ -33,7 +33,8 @@ class AdditionalInfoType:
3333
@dataclass
3434
class APNType:
3535
"""
36-
Collection of configuration data needed to make a data-connection over a cellular network.
36+
Collection of configuration data needed to make a data-connection over a
37+
cellular network.
3738
APNType is used by: SetNetworkProfileRequest.NetworkConnectionProfileType
3839
"""
3940

@@ -49,7 +50,8 @@ class APNType:
4950
@dataclass
5051
class CertificateHashDataType:
5152
"""
52-
CertificateHashDataType is used by: CertificateHashDataChainType, DeleteCertificateRequest, CustomerInformationRequest
53+
CertificateHashDataType is used by: CertificateHashDataChainType,
54+
DeleteCertificateRequest, CustomerInformationRequest
5355
"""
5456

5557
hash_algorithm: enums.HashAlgorithmType
@@ -109,7 +111,8 @@ class ChargingNeedsType:
109111
@dataclass
110112
class ChargingProfileCriterionType:
111113
"""
112-
A ChargingProfile consists of ChargingSchedule, describing the amount of power or current that can be delivered per time interval.
114+
A ChargingProfile consists of ChargingSchedule, describing the amount of
115+
power or current that can be delivered per time interval.
113116
ChargingProfileCriterionType is used by: GetChargingProfilesRequest
114117
"""
115118

@@ -122,8 +125,10 @@ class ChargingProfileCriterionType:
122125
@dataclass
123126
class ChargingSchedulePeriodType:
124127
"""
125-
Charging schedule period structure defines a time period in a charging schedule.
126-
ChargingSchedulePeriodType is used by: ChargingScheduleType, CompositeScheduleType
128+
Charging schedule period structure defines a time period in a charging
129+
schedule.
130+
ChargingSchedulePeriodType is used by: ChargingScheduleType,
131+
CompositeScheduleType
127132
"""
128133

129134
start_period: int
@@ -186,8 +191,10 @@ class SalesTariffType:
186191
@dataclass
187192
class ChargingScheduleType:
188193
"""
189-
Charging schedule structure defines a list of charging periods, as used in: GetCompositeSchedule.conf and ChargingProfile.
190-
ChargingScheduleType is used by: ChargingProfileType, NotifyChargingLimitRequest, NotifyEVChargingScheduleRequest
194+
Charging schedule structure defines a list of charging periods, as used in:
195+
GetCompositeSchedule.conf and ChargingProfile.
196+
ChargingScheduleType is used by: ChargingProfileType,
197+
NotifyChargingLimitRequest, NotifyEVChargingScheduleRequest
191198
"""
192199

193200
id: int
@@ -202,8 +209,10 @@ class ChargingScheduleType:
202209
@dataclass
203210
class ChargingProfileType:
204211
"""
205-
A ChargingProfile consists of ChargingSchedule, describing the amount of power or current that can be delivered per time interval.
206-
ChargingProfileType is used by: RequestStartTransactionRequest, SetChargingProfileRequest, ReportChargingProfilesRequest
212+
A ChargingProfile consists of ChargingSchedule, describing the amount of
213+
power or current that can be delivered per time interval.
214+
ChargingProfileType is used by: RequestStartTransactionRequest,
215+
SetChargingProfileRequest, ReportChargingProfilesRequest
207216
"""
208217

209218
id: int
@@ -220,7 +229,8 @@ class ChargingProfileType:
220229
@dataclass
221230
class ClearChargingProfileType:
222231
"""
223-
A ChargingProfile consists of a ChargingSchedule, describing the amount of power or current that can be delivered per time interval.
232+
A ChargingProfile consists of a ChargingSchedule, describing the amount of
233+
power or current that can be delivered per time interval.
224234
ClearChargingProfileType is used by: ClearChargingProfileRequest
225235
"""
226236

@@ -233,7 +243,26 @@ class ClearChargingProfileType:
233243
class StatusInfoType:
234244
"""
235245
Element providing more information about the status.
236-
StatusInfoType is used by: ClearMonitoringResultType, BootNotificationResponse, CancelReservationResponse, TriggerMessageResponse, UnlockConnectorResponse, UpdateFirmwareResponse, ClearDisplayMessageResponse, Get15118EVCertificateResponse, GetCompositeScheduleResponse, ChangeAvailabilityResponse, GetLogResponse, ClearChargingProfileResponse, NotifyEVChargingNeedsResponse, ClearCacheResponse, NotifyEVChargingScheduleResponse, RequestStartTransactionResponse, RequestStopTransactionResponse, SetChargingProfileResponse, SetDisplayMessageResponse, SetNetworkProfileResponse, SignCertificateResponse, DataTransferResponse, CertificateSignedResponse, DeleteCertificateResponse, GetChargingProfilesResponse, GetInstalledCertificateIdsResponse, InstallCertificateResponse, GetBaseReportResponse, GetMonitoringReportResponse, GetReportResponse, GetVariablesResponse.GetVariableResultType, ReserveNowResponse, SetMonitoringBaseResponse, SetMonitoringLevelResponse, SetVariableMonitoringResponse.SetMonitoringResultType, SetVariablesResponse.SetVariableResultType, PublishFirmwareResponse, GetCertificateStatusResponse, ResetResponse, GetDisplayMessagesResponse, CustomerInformationResponse, SendLocalListResponse
246+
StatusInfoType is used by: ClearMonitoringResultType,
247+
BootNotificationResponse, CancelReservationResponse,
248+
TriggerMessageResponse, UnlockConnectorResponse, UpdateFirmwareResponse,
249+
ClearDisplayMessageResponse, Get15118EVCertificateResponse,
250+
GetCompositeScheduleResponse, ChangeAvailabilityResponse, GetLogResponse,
251+
ClearChargingProfileResponse, NotifyEVChargingNeedsResponse,
252+
ClearCacheResponse, NotifyEVChargingScheduleResponse,
253+
RequestStartTransactionResponse, RequestStopTransactionResponse,
254+
SetChargingProfileResponse, SetDisplayMessageResponse,
255+
SetNetworkProfileResponse, SignCertificateResponse, DataTransferResponse,
256+
CertificateSignedResponse, DeleteCertificateResponse,
257+
GetChargingProfilesResponse, GetInstalledCertificateIdsResponse,
258+
InstallCertificateResponse, GetBaseReportResponse,
259+
GetMonitoringReportResponse, GetReportResponse,
260+
GetVariablesResponse.GetVariableResultType, ReserveNowResponse,
261+
SetMonitoringBaseResponse, SetMonitoringLevelResponse,
262+
SetVariableMonitoringResponse.SetMonitoringResultType,
263+
SetVariablesResponse.SetVariableResultType, PublishFirmwareResponse,
264+
GetCertificateStatusResponse, ResetResponse, GetDisplayMessagesResponse,
265+
CustomerInformationResponse, SendLocalListResponse
237266
"""
238267

239268
reason_code: str
@@ -255,7 +284,8 @@ class ClearMonitoringResultType:
255284
class EVSEType:
256285
"""
257286
Electric Vehicle Supply Equipment
258-
EVSEType is used by: ComponentType, TriggerMessageRequest, ChangeAvailabilityRequest, TransactionEventRequest
287+
EVSEType is used by: ComponentType, TriggerMessageRequest,
288+
ChangeAvailabilityRequest, TransactionEventRequest
259289
"""
260290

261291
id: int
@@ -266,7 +296,16 @@ class EVSEType:
266296
class ComponentType:
267297
"""
268298
A physical or logical component.
269-
ComponentType is used by: ComponentVariableType, MessageInfoType, GetVariablesRequest.GetVariableDataType, GetVariablesResponse.GetVariableResultType, NotifyMonitoringReportRequest.MonitoringDataType, NotifyReportRequest.ReportDataType, SetVariableMonitoringRequest.SetMonitoringDataType, SetVariableMonitoringResponse.SetMonitoringResultType, SetVariablesRequest.SetVariableDataType, SetVariablesResponse.SetVariableResultType, NotifyEventRequest.EventDataType
299+
ComponentType is used by: ComponentVariableType, MessageInfoType,
300+
GetVariablesRequest.GetVariableDataType,
301+
GetVariablesResponse.GetVariableResultType,
302+
NotifyMonitoringReportRequest.MonitoringDataType,
303+
NotifyReportRequest.ReportDataType,
304+
SetVariableMonitoringRequest.SetMonitoringDataType,
305+
SetVariableMonitoringResponse.SetMonitoringResultType,
306+
SetVariablesRequest.SetVariableDataType,
307+
SetVariablesResponse.SetVariableResultType,
308+
NotifyEventRequest.EventDataType
270309
"""
271310

272311
name: str
@@ -278,7 +317,16 @@ class ComponentType:
278317
class VariableType:
279318
"""
280319
Reference key to a component-variable.
281-
VariableType is used by: ComponentVariableType, GetVariablesRequest.GetVariableDataType, GetVariablesResponse.GetVariableResultType, NotifyMonitoringReportRequest.MonitoringDataType, NotifyReportRequest.ReportDataType, SetVariableMonitoringRequest.SetMonitoringDataType, SetVariableMonitoringResponse.SetMonitoringResultType, SetVariablesRequest.SetVariableDataType, SetVariablesResponse.SetVariableResultType, NotifyEventRequest.EventDataType
320+
VariableType is used by: ComponentVariableType,
321+
GetVariablesRequest.GetVariableDataType,
322+
GetVariablesResponse.GetVariableResultType,
323+
NotifyMonitoringReportRequest.MonitoringDataType,
324+
NotifyReportRequest.ReportDataType,
325+
SetVariableMonitoringRequest.SetMonitoringDataType,
326+
SetVariableMonitoringResponse.SetMonitoringResultType,
327+
SetVariablesRequest.SetVariableDataType,
328+
SetVariablesResponse.SetVariableResultType,
329+
NotifyEventRequest.EventDataType
282330
"""
283331

284332
name: str
@@ -288,7 +336,10 @@ class VariableType:
288336
@dataclass
289337
class ComponentVariableType:
290338
"""
291-
Class to report components, variables and variable attributes and characteristics. ComponentVariableType is used by: GetMonitoringReportRequest , GetReportRequest
339+
Class to report components, variables and variable attributes and
340+
characteristics.
341+
ComponentVariableType is used by: GetMonitoringReportRequest,
342+
GetReportRequest
292343
"""
293344

294345
component: ComponentType
@@ -353,7 +404,9 @@ class EventDataType:
353404
@dataclass
354405
class FirmwareType:
355406
"""
356-
Represents a copy of the firmware that can be loaded/updated on the Charging Station. FirmwareType is used by: UpdateFirmwareRequest
407+
Represents a copy of the firmware that can be loaded/updated on the
408+
Charging Station.
409+
FirmwareType is used by: UpdateFirmwareRequest
357410
"""
358411

359412
location: str
@@ -391,8 +444,11 @@ class GetVariableResultType:
391444
@dataclass
392445
class IdTokenType:
393446
"""
394-
Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
395-
IdTokenType is used by: AuthorizationData, Common:IdTokenInfoType, RequestStartTransactionRequest, AuthorizeRequest, TransactionEventRequest, ReserveNowRequest, CustomerInformationRequest
447+
Contains a case insensitive identifier to use for the authorization and the
448+
type of authorization to support multiple forms of identifiers.
449+
IdTokenType is used by: AuthorizationData, Common:IdTokenInfoType,
450+
RequestStartTransactionRequest, AuthorizeRequest, TransactionEventRequest,
451+
ReserveNowRequest, CustomerInformationRequest
396452
"""
397453

398454
id_token: str
@@ -404,7 +460,8 @@ class IdTokenType:
404460
class MessageContentType:
405461
"""
406462
Contains message details, for a message to be displayed on a Charging Station.
407-
MessageContentType is used by: IdTokenInfoType, MessageInfoType, TransactionEventResponse
463+
MessageContentType is used by: IdTokenInfoType, MessageInfoType,
464+
TransactionEventResponse
408465
"""
409466

410467
format: enums.MessageFormatType
@@ -415,8 +472,12 @@ class MessageContentType:
415472
@dataclass
416473
class IdTokenInfoType:
417474
"""
418-
Contains status information about an identifier. It is advised to not stop charging for a token that expires during charging, as ExpiryDate is only used for caching purposes. If ExpiryDate is not given, the status has no end date.
419-
IdTokenInfoType is used by: AuthorizationData, AuthorizeResponse, TransactionEventResponse
475+
Contains status information about an identifier. It is advised to not stop
476+
charging for a token that expires during charging, as ExpiryDate is only
477+
used for caching purposes. If ExpiryDate is not given, the status has no
478+
end date.
479+
IdTokenInfoType is used by: AuthorizationData, AuthorizeResponse,
480+
TransactionEventResponse
420481
"""
421482

422483
status: enums.AuthorizationStatusType
@@ -455,7 +516,10 @@ class LogParametersType:
455516
@dataclass
456517
class MessageInfoType:
457518
"""
458-
Contains message details, for a message to be displayed on a Charging Station. MessageInfoType is used by: SetDisplayMessageRequest, NotifyDisplayMessagesRequest
519+
Contains message details, for a message to be displayed on a Charging
520+
Station.
521+
MessageInfoType is used by: SetDisplayMessageRequest,
522+
NotifyDisplayMessagesRequest
459523
"""
460524

461525
id: int
@@ -495,8 +559,11 @@ class UnitOfMeasureType:
495559
@dataclass
496560
class SampledValueType:
497561
"""
498-
Single sampled value in MeterValues. Each value can be accompanied by optional fields.
499-
To save on mobile data usage, default values of all of the optional fields are such that. The value without any additional fields will be interpreted, as a register reading of active import energy in Wh (Watt-hour) units.
562+
Single sampled value in MeterValues. Each value can be accompanied by
563+
optional fields.
564+
To save on mobile data usage, default values of all of the optional fields
565+
are such that. The value without any additional fields will be interpreted,
566+
as a register reading of active import energy in Wh (Watt-hour) units.
500567
SampledValueType is used by: MeterValueType
501568
"""
502569

@@ -511,7 +578,9 @@ class SampledValueType:
511578
@dataclass
512579
class MeterValueType:
513580
"""
514-
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.
581+
Collection of one or more sampled values in MeterValuesRequest and
582+
TransactionEvent. All sampled values in a MeterValue are sampled at the
583+
same point in time.
515584
MeterValueType is used by: MeterValuesRequest, TransactionEventRequest
516585
"""
517586

@@ -522,7 +591,8 @@ class MeterValueType:
522591
@dataclass
523592
class ModemType:
524593
"""
525-
Defines parameters required for initiating and maintaining wireless communication with other devices.
594+
Defines parameters required for initiating and maintaining wireless
595+
communication with other devices.
526596
ModemType is used by: BootNotificationRequest.ChargingStationType
527597
"""
528598

@@ -534,7 +604,8 @@ class ModemType:
534604
class VariableMonitoringType:
535605
"""
536606
A monitoring setting for a variable.
537-
VariableMonitoringType is used by: NotifyMonitoringReportRequest.MonitoringDataType
607+
VariableMonitoringType is used by:
608+
NotifyMonitoringReportRequest.MonitoringDataType
538609
"""
539610

540611
id: int
@@ -574,7 +645,8 @@ class VPNType:
574645
@dataclass
575646
class NetworkConnectionProfileType:
576647
"""
577-
The NetworkConnectionProfile defines the functional and technical parameters of a communication link.
648+
The NetworkConnectionProfile defines the functional and technical
649+
parameters of a communication link.
578650
NetworkConnectionProfileType is used by: SetNetworkProfileRequest
579651
"""
580652

@@ -604,7 +676,10 @@ class ChargingStationType:
604676

605677
@dataclass
606678
class OCSPRequestDataType:
607-
"""OCSPRequestDataType is used by: AuthorizeRequest, GetCertificateStatusRequest"""
679+
"""
680+
OCSPRequestDataType is used by: AuthorizeRequest,
681+
GetCertificateStatusRequest
682+
"""
608683

609684
hash_algorithm: enums.HashAlgorithmType
610685
issuer_name_hash: str
@@ -644,7 +719,11 @@ class VariableCharacteristicsType:
644719

645720
@dataclass
646721
class ReportDataType:
647-
"""Class to report components, variables and variable attributes and characteristics"""
722+
"""
723+
Class to report components, variables and variable attributes and
724+
characteristics
725+
ReportDataType is used by: NotifyReportRequest
726+
"""
648727

649728
component: ComponentType
650729
variable: VariableType

0 commit comments

Comments
 (0)