Skip to content

Commit 958b72e

Browse files
committed
Update MarketLocationIdType enum mapping to match latest API
The generated protobuf code in the latest API release has removed the 'OFFICIAL_' prefix from the market location ID type enum members. This commit updates the client mapping to match the new names. Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent d321a8c commit 958b72e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ classifiers = [
3939
requires-python = ">= 3.11, < 4"
4040
dependencies = [
4141
"typing-extensions >= 4.13.0, < 5",
42-
"frequenz-api-marketmetering @ git+https://github.com/frequenz-io/[email protected]",
42+
"frequenz-api-marketmetering @ git+https://github.com/frequenz-floss/[email protected]",
4343
"frequenz-client-base >= 0.11.0, < 0.12.0",
4444
"grpcio >= 1.74.0, < 2",
4545
]
@@ -72,7 +72,7 @@ dev-mkdocs = [
7272
"mike == 2.1.3",
7373
"mkdocs-gen-files == 0.5.0",
7474
"mkdocs-literate-nav == 0.6.2",
75-
"frequenz-api-marketmetering @ git+https://github.com/frequenz-io/[email protected]",
75+
"frequenz-api-marketmetering @ git+https://github.com/frequenz-floss/[email protected]",
7676
"mkdocs-macros-plugin == 1.4.1",
7777
"mkdocs-material == 9.6.23",
7878
"mkdocstrings[python] == 0.30.1",
@@ -91,7 +91,7 @@ dev-pylint = [
9191
"pylint == 3.3.9",
9292
# For checking the noxfile, docs/ script, and tests
9393
"frequenz-client-marketmetering[cli,dev-mkdocs,dev-noxfile,dev-pytest]",
94-
"frequenz-api-marketmetering @ git+https://github.com/frequenz-io/[email protected]",
94+
"frequenz-api-marketmetering @ git+https://github.com/frequenz-floss/[email protected]",
9595
]
9696
dev-pytest = [
9797
"pytest == 8.4.2",

src/frequenz/client/marketmetering/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ async def stream_samples(
201201
"""
202202
# Build the request
203203
request = pb.ReceiveMarketLocationSamplesStreamRequest(
204-
market_location_list=[ml.to_protobuf() for ml in market_locations],
204+
market_location_refs=[ml.to_protobuf() for ml in market_locations],
205205
directions=[d.value for d in directions],
206206
metric_types=[mt.value for mt in metric_types],
207207
)
@@ -314,7 +314,7 @@ def _get_stream(
314314
if broadcaster is None:
315315
# Build the request
316316
request = pb.ReceiveMarketLocationSamplesStreamRequest(
317-
market_location_list=[ml.to_protobuf() for ml in market_locations],
317+
market_location_refs=[ml.to_protobuf() for ml in market_locations],
318318
directions=[d.value for d in directions],
319319
metric_types=[mt.value for mt in metric_types],
320320
)

src/frequenz/client/marketmetering/types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ class MarketArea(Enum):
4040
class MarketLocationIdType(Enum):
4141
"""Type of external market identifier."""
4242

43-
UNSPECIFIED = pb.OFFICIAL_MARKET_LOCATION_ID_TYPE_UNSPECIFIED
43+
UNSPECIFIED = pb.MARKET_LOCATION_ID_TYPE_UNSPECIFIED
4444
"""Unspecified identifier type."""
4545

46-
MALO_ID = pb.OFFICIAL_MARKET_LOCATION_ID_TYPE_MALO_ID
46+
MALO_ID = pb.MARKET_LOCATION_ID_TYPE_MALO_ID
4747
"""Germany – Marktlokations-ID (MaLo-ID)."""
4848

49-
MPAN = pb.OFFICIAL_MARKET_LOCATION_ID_TYPE_MPAN
49+
MPAN = pb.MARKET_LOCATION_ID_TYPE_MPAN
5050
"""United Kingdom – Meter Point Administration Number."""
5151

52-
ESI_ID = pb.OFFICIAL_MARKET_LOCATION_ID_TYPE_ESI_ID
52+
ESI_ID = pb.MARKET_LOCATION_ID_TYPE_ESI_ID
5353
"""United States – Electric Service Identifier (ESI ID)."""
5454

55-
NMI = pb.OFFICIAL_MARKET_LOCATION_ID_TYPE_NMI
55+
NMI = pb.MARKET_LOCATION_ID_TYPE_NMI
5656
"""Australia – National Metering Identifier."""
5757

58-
OTHER = pb.OFFICIAL_MARKET_LOCATION_ID_TYPE_OTHER
58+
OTHER = pb.MARKET_LOCATION_ID_TYPE_OTHER
5959
"""Generic meter identifier for markets not modeled explicitly."""
6060

6161

0 commit comments

Comments
 (0)