Skip to content

Commit 78835cd

Browse files
authored
Support tags in CLI create-order command (#193)
2 parents 9fbd620 + 58961c1 commit 78835cd

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66

77
## Upgrading
88

9-
* Widen the version range of api-common to also allow v0.8.x.
10-
* Restrict entsoe client dependency version range up to v0.7.x.
11-
* Listing gridpool orders that do not contain a price or quantity no longer raises an exception. Users must validate orders themselves.
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1210

1311
## New Features
1412

15-
<!-- Here goes the main new features and examples or instructions on how to use them -->
13+
* Support tags in CLI create-order command.
1614

1715
## Bug Fixes
1816

19-
* Fixed typo in the trading CLI help text.
17+
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->

src/frequenz/client/electricity_trading/cli/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def receive_gridpool_orders(
168168
@click.option("--currency", default="EUR", type=str)
169169
@click.option("--duration", default=900, type=int)
170170
@click.option("--sign_secret", default=None, type=str)
171+
@click.option("--tag", default=None, type=str)
171172
def create_order(
172173
# pylint: disable=too-many-arguments
173174
url: str,
@@ -181,6 +182,7 @@ def create_order(
181182
currency: str,
182183
duration: int,
183184
sign_secret: str | None = None,
185+
tag: str | None = None,
184186
) -> None:
185187
"""Create an order.
186188
@@ -201,6 +203,7 @@ def create_order(
201203
currency=currency,
202204
duration=timedelta(seconds=duration),
203205
sign_secret=sign_secret,
206+
tag=tag,
204207
)
205208
)
206209

src/frequenz/client/electricity_trading/cli/etrading.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ async def create_order(
233233
currency: str,
234234
duration: timedelta,
235235
sign_secret: str | None = None,
236+
tag: str | None = None,
236237
) -> None:
237238
"""Create a limit order for a given price and quantity (in MW).
238239
@@ -251,6 +252,7 @@ async def create_order(
251252
currency: Currency of the price.
252253
duration: Duration of the delivery period.
253254
sign_secret: The cryptographic secret to use for HMAC generation.
255+
tag: Optional tag to attach to the order.
254256
"""
255257
client = Client(server_url=url, auth_key=auth_key, sign_secret=sign_secret)
256258

@@ -274,6 +276,7 @@ async def create_order(
274276
currency=Currency[currency],
275277
),
276278
quantity=quantity,
279+
tag=tag,
277280
)
278281

279282
print_order(order)

0 commit comments

Comments
 (0)