Skip to content

Commit 9e40584

Browse files
jerome-benoitgruttsproelke
authored
Use dataclasses for ChargingProfile usage (#648)
PR #172 updated with master. Smart charging algos conception and validation has become a requirement for charging infrastructure. Every single code lines that can help at implementing and testing it worse the effort. closes #172 Associated unit tests PR: #690 --------- Signed-off-by: Jérôme Benoit <[email protected]> Co-authored-by: Adrian Gruetter <[email protected]> Co-authored-by: grutts <[email protected]> Co-authored-by: Patrick Roelke <[email protected]>
1 parent 23c8e8d commit 9e40584

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ocpp/v16/call.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import warnings
22
from dataclasses import dataclass, field
3-
from typing import Dict, List, Optional
3+
from typing import Dict, List, Optional, Union
44

5+
from ocpp.v16.datatypes import ChargingProfile
56
from ocpp.v16.enums import (
67
AvailabilityType,
78
CertificateUse,
@@ -133,7 +134,7 @@ class InstallCertificate:
133134
class RemoteStartTransaction:
134135
id_tag: str
135136
connector_id: Optional[int] = None
136-
charging_profile: Optional[Dict] = None
137+
charging_profile: Optional[Union[Dict, ChargingProfile]] = None
137138

138139

139140
@dataclass
@@ -165,7 +166,7 @@ class SendLocalList:
165166
@dataclass
166167
class SetChargingProfile:
167168
connector_id: int
168-
cs_charging_profiles: Dict
169+
cs_charging_profiles: Union[ChargingProfile, Dict]
169170

170171

171172
@dataclass

0 commit comments

Comments
 (0)