openadr3-client-gac-compliance 0.0.2__py3-none-any.whl → 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  from openadr3_client_gac_compliance.config import GAC_VERSION
2
2
 
3
- if GAC_VERSION == "3.0":
4
- import openadr3_client_gac_compliance.gac30.program_gac_compliant # noqa: F401
5
- import openadr3_client_gac_compliance.gac30.event_gac_compliant # noqa: F401
3
+ if GAC_VERSION == "2.0":
4
+ import openadr3_client_gac_compliance.gac20.program_gac_compliant # noqa: F401
5
+ import openadr3_client_gac_compliance.gac20.event_gac_compliant # noqa: F401
@@ -2,7 +2,7 @@
2
2
 
3
3
  from decouple import config
4
4
 
5
- VALID_GAC_VERSIONS: list[str] = ["3.0"]
5
+ VALID_GAC_VERSIONS: list[str] = ["2.0"]
6
6
 
7
7
 
8
8
  def _gac_version_cast(value: str) -> str:
@@ -23,4 +23,4 @@ def _gac_version_cast(value: str) -> str:
23
23
 
24
24
 
25
25
  # The GAC version to use for the compliance validators.
26
- GAC_VERSION = config("GAC_VERSION", default="3.0", cast=_gac_version_cast)
26
+ GAC_VERSION = config("GAC_VERSION", default="2.0", cast=_gac_version_cast)
@@ -0,0 +1,4 @@
1
+ # This module imports all the GAC 3.0 compliance validators.
2
+
3
+ import openadr3_client_gac_compliance.gac20.program_gac_compliant # noqa: F401
4
+ import openadr3_client_gac_compliance.gac20.event_gac_compliant # noqa: F401
@@ -182,16 +182,12 @@ def event_gac_compliant(self: Event) -> Event:
182
182
 
183
183
  GAC enforces the following constraints for events:
184
184
 
185
- - The event must have a priority set.
186
- - The priority must be greater than or equal to 0 and less than or equal to 999.
185
+ - The event must not have a priority set.
187
186
  - The event must have either a continuous or seperated interval definition.
188
187
  """
189
- if self.priority is None:
190
- raise ValueError("The event must have a priority set.")
191
-
192
- if self.priority > 999:
188
+ if self.priority is not None:
193
189
  raise ValueError(
194
- "The priority must be greater than or equal to 0 and less than or equal to 999."
190
+ "The event must not have a priority set for GAC 2.0 compliance"
195
191
  )
196
192
 
197
193
  interval_periods_validated = _continuous_or_seperated(self)
@@ -12,7 +12,7 @@ def program_gac_compliant(self: Program) -> Program:
12
12
 
13
13
  GAC enforces the following constraints for programs:
14
14
  - The program must have a retailer name
15
- - The retailer name must be an EAN13 identifier.
15
+ - The retailer name must be between 2 and 128 characters long.
16
16
  - The program MUST have a programType.
17
17
  - The programType MUST equal "DSO_CPO_INTERFACE-x.x.x, where x.x.x is the version as defined in the GAC specification.
18
18
  - The program MUST have bindingEvents set to True.
@@ -22,8 +22,9 @@ def program_gac_compliant(self: Program) -> Program:
22
22
 
23
23
  if self.retailer_name is None:
24
24
  raise ValueError("The program must have a retailer name.")
25
- if not re.fullmatch(r"\d{13}", self.retailer_name):
26
- raise ValueError("The retailer name must be an EAN13 identifier.")
25
+
26
+ if len(self.retailer_name) < 2 or len(self.retailer_name) > 128:
27
+ raise ValueError("The retailer name must be between 2 and 128 characters long.")
27
28
 
28
29
  if self.program_type is None:
29
30
  raise ValueError("The program must have a program type.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openadr3-client-gac-compliance
3
- Version: 0.0.2
3
+ Version: 1.0.0
4
4
  Summary:
5
5
  Author: Nick van der Burgt
6
6
  Author-email: nick.van.der.burgt@elaad.nl
@@ -0,0 +1,10 @@
1
+ openadr3_client_gac_compliance/__init__.py,sha256=egRqRuKCda3enw9i_ETYHKIB9WsqpCxS1vfE1dgDuYM,254
2
+ openadr3_client_gac_compliance/config.py,sha256=X_KEl99bUm05rH0IOKLyeR4Zn2utdC8U3vLkdG8MYXU,675
3
+ openadr3_client_gac_compliance/gac20/__init__.py,sha256=YPjRHMl-uR6ZwrDGjY_EboScHe_VhTrovso_zDOSd6o,220
4
+ openadr3_client_gac_compliance/gac20/event_gac_compliant.py,sha256=KPcUyazlroFv0c3IovvtMW4a4LD2lBOyct4ptjngixk,7970
5
+ openadr3_client_gac_compliance/gac20/program_gac_compliant.py,sha256=qJeyvAdu0f6F0I3iXXl64dOVRZwPfRHQyGqc3ECuzjw,1725
6
+ openadr3_client_gac_compliance/gac21/__init__.py,sha256=GTu1EyBj2T72zT3MKPettcvP-DNCJ0p6oAMj3Z-08N0,61
7
+ openadr3_client_gac_compliance-1.0.0.dist-info/LICENSE.md,sha256=NNNxKzhSK6afX-UaN8WZIVtMi5Tu8dVr6q3ciTSnH-g,10250
8
+ openadr3_client_gac_compliance-1.0.0.dist-info/METADATA,sha256=07N5vVZT-0rESlP8Nl2DOAn3kZ9XOh_MJjarqXxfoMY,1052
9
+ openadr3_client_gac_compliance-1.0.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
+ openadr3_client_gac_compliance-1.0.0.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- # This module imports all the GAC 3.0 compliance validators.
2
-
3
- import openadr3_client_gac_compliance.gac30.program_gac_compliant # noqa: F401
4
- import openadr3_client_gac_compliance.gac30.event_gac_compliant # noqa: F401
@@ -1,10 +0,0 @@
1
- openadr3_client_gac_compliance/__init__.py,sha256=Kla5pd6kvbbCqZdSaqlZbNfmZZe2BUWax19EHqGrHeE,254
2
- openadr3_client_gac_compliance/config.py,sha256=e8UfHlvSbNKziFN572lbxDJ8vCfh-Jv_5eDLi00lYog,675
3
- openadr3_client_gac_compliance/gac30/__init__.py,sha256=UOgLJqVCWTiiHB6rXiDFWndUlF3hZQ8IDy6qb69bPkc,220
4
- openadr3_client_gac_compliance/gac30/event_gac_compliant.py,sha256=s-pxU0lKm7MD0W0jAgKDAhnakuK1DuZhx83mtLID3zs,8157
5
- openadr3_client_gac_compliance/gac30/program_gac_compliant.py,sha256=fAmMaRumpMppvxaNonTAYTXQIWryUnuJjnsS-cCkYjE,1683
6
- openadr3_client_gac_compliance/gac31/__init__.py,sha256=GTu1EyBj2T72zT3MKPettcvP-DNCJ0p6oAMj3Z-08N0,61
7
- openadr3_client_gac_compliance-0.0.2.dist-info/LICENSE.md,sha256=NNNxKzhSK6afX-UaN8WZIVtMi5Tu8dVr6q3ciTSnH-g,10250
8
- openadr3_client_gac_compliance-0.0.2.dist-info/METADATA,sha256=EuXZG4d0TiX_Ig4ustohso02q8u61T31DhD0Yjiwp3k,1052
9
- openadr3_client_gac_compliance-0.0.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
- openadr3_client_gac_compliance-0.0.2.dist-info/RECORD,,