Skip to content

Commit

Permalink
Use dataclasses for ChargingProfile usage (#648)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
4 people authored Dec 18, 2024
1 parent 23c8e8d commit 9e40584
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ocpp/v16/call.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import warnings
from dataclasses import dataclass, field
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Union

from ocpp.v16.datatypes import ChargingProfile
from ocpp.v16.enums import (
AvailabilityType,
CertificateUse,
Expand Down Expand Up @@ -133,7 +134,7 @@ class InstallCertificate:
class RemoteStartTransaction:
id_tag: str
connector_id: Optional[int] = None
charging_profile: Optional[Dict] = None
charging_profile: Optional[Union[Dict, ChargingProfile]] = None


@dataclass
Expand Down Expand Up @@ -165,7 +166,7 @@ class SendLocalList:
@dataclass
class SetChargingProfile:
connector_id: int
cs_charging_profiles: Dict
cs_charging_profiles: Union[ChargingProfile, Dict]


@dataclass
Expand Down

0 comments on commit 9e40584

Please sign in to comment.