openadr3-client-gac-compliance 1.2.1__py3-none-any.whl → 1.3.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.
@@ -86,17 +86,15 @@ def _targets_compliant(self: Event) -> Tuple[Event, list[InitErrorDetails]]:
86
86
 
87
87
  GAC enforces the following constraints for targets:
88
88
 
89
- - The event must contain a POWER_SERVICE_LOCATIONS target.
90
- - The POWER_SERVICE_LOCATIONS target value must be a list of 'EAN18' values.
89
+ - The event must contain a POWER_SERVICE_LOCATION target.
90
+ - The POWER_SERVICE_LOCATION target value must be a list of 'EAN18' values.
91
91
  - The event must contain a VEN_NAME target.
92
92
  - The VEN_NAME target value must be a list of 'ven object name' values (between 1 and 128 characters).
93
93
  """
94
94
  validation_errors: list[InitErrorDetails] = []
95
95
  targets = self.targets or ()
96
96
 
97
- power_service_locations = [
98
- t for t in targets if t.type == "POWER_SERVICE_LOCATIONS"
99
- ]
97
+ power_service_locations = [t for t in targets if t.type == "POWER_SERVICE_LOCATION"]
100
98
  ven_names = [t for t in targets if t.type == "VEN_NAME"]
101
99
 
102
100
  if not power_service_locations:
@@ -104,7 +102,7 @@ def _targets_compliant(self: Event) -> Tuple[Event, list[InitErrorDetails]]:
104
102
  InitErrorDetails(
105
103
  type=PydanticCustomError(
106
104
  "value_error",
107
- "The event must contain a POWER_SERVICE_LOCATIONS target.",
105
+ "The event must contain a POWER_SERVICE_LOCATION target.",
108
106
  ),
109
107
  loc=("targets",),
110
108
  input=self.targets,
@@ -130,7 +128,7 @@ def _targets_compliant(self: Event) -> Tuple[Event, list[InitErrorDetails]]:
130
128
  InitErrorDetails(
131
129
  type=PydanticCustomError(
132
130
  "value_error",
133
- "The event must contain exactly one POWER_SERVICE_LOCATIONS target.",
131
+ "The event must contain exactly one POWER_SERVICE_LOCATION target.",
134
132
  ),
135
133
  loc=("targets",),
136
134
  input=self.targets,
@@ -165,7 +163,7 @@ def _targets_compliant(self: Event) -> Tuple[Event, list[InitErrorDetails]]:
165
163
  InitErrorDetails(
166
164
  type=PydanticCustomError(
167
165
  "value_error",
168
- "The POWER_SERVICE_LOCATIONS target value cannot be empty.",
166
+ "The POWER_SERVICE_LOCATION target value cannot be empty.",
169
167
  ),
170
168
  loc=("targets",),
171
169
  input=self.targets,
@@ -173,12 +171,14 @@ def _targets_compliant(self: Event) -> Tuple[Event, list[InitErrorDetails]]:
173
171
  )
174
172
  )
175
173
 
176
- if not all(re.fullmatch(r"\d{18}", v) for v in power_service_location.values):
174
+ if not all(
175
+ re.fullmatch(r"^EAN\d{15}$", v) for v in power_service_location.values
176
+ ):
177
177
  validation_errors.append(
178
178
  InitErrorDetails(
179
179
  type=PydanticCustomError(
180
180
  "value_error",
181
- "The POWER_SERVICE_LOCATIONS target value must be a list of 'EAN18' values.",
181
+ "The POWER_SERVICE_LOCATION target value must be a list of 'EAN18' values.",
182
182
  ),
183
183
  loc=("targets",),
184
184
  input=self.targets,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openadr3-client-gac-compliance
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary:
5
5
  Author: Nick van der Burgt
6
6
  Author-email: nick.van.der.burgt@elaad.nl
@@ -1,11 +1,11 @@
1
1
  openadr3_client_gac_compliance/__init__.py,sha256=dzf9YdOlssEb9GSIoThaMzEJ956G-hpLi7HIXRC3TR8,334
2
2
  openadr3_client_gac_compliance/config.py,sha256=X_KEl99bUm05rH0IOKLyeR4Zn2utdC8U3vLkdG8MYXU,675
3
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=dZIVRRgpRajkceu8IDLNaz9b0lNmlFfWjdlAvlxymTo,15060
4
+ openadr3_client_gac_compliance/gac20/event_gac_compliant.py,sha256=tktjQHDCXg76k_DksYcXmDV4lIeRLloE80ETK1bS6GQ,15066
5
5
  openadr3_client_gac_compliance/gac20/program_gac_compliant.py,sha256=i7l9oboA31_HMHZ-b8GbVTXGfeNCL3kF-o5e7--riCg,3540
6
6
  openadr3_client_gac_compliance/gac20/ven_gac_compliant.py,sha256=57MH73JorFSNyeB6Tep4XX_WMhtKls2DXoSoBaMhob8,1751
7
7
  openadr3_client_gac_compliance/gac21/__init__.py,sha256=GTu1EyBj2T72zT3MKPettcvP-DNCJ0p6oAMj3Z-08N0,61
8
- openadr3_client_gac_compliance-1.2.1.dist-info/LICENSE.md,sha256=NNNxKzhSK6afX-UaN8WZIVtMi5Tu8dVr6q3ciTSnH-g,10250
9
- openadr3_client_gac_compliance-1.2.1.dist-info/METADATA,sha256=n5GMDEvlXrEreakDfUWYiVOTZF7mgT1W8JzzhhsGK6g,1096
10
- openadr3_client_gac_compliance-1.2.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
- openadr3_client_gac_compliance-1.2.1.dist-info/RECORD,,
8
+ openadr3_client_gac_compliance-1.3.0.dist-info/LICENSE.md,sha256=NNNxKzhSK6afX-UaN8WZIVtMi5Tu8dVr6q3ciTSnH-g,10250
9
+ openadr3_client_gac_compliance-1.3.0.dist-info/METADATA,sha256=_ECpcxY77Yc71oltWj3RuHTdO7oIDocNGMpNBpWnlzI,1096
10
+ openadr3_client_gac_compliance-1.3.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
+ openadr3_client_gac_compliance-1.3.0.dist-info/RECORD,,