Skip to content

Commit ecf44ef

Browse files
authored
Add steam boiler dispatch target support (#333)
2 parents d5cfeb2 + 81f2516 commit ecf44ef

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎RELEASE_NOTES.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Raise `ValueError` when `start_time` passed to `create()` is neither a `datetime
1212

1313
<!-- Here goes the main new features and examples or instructions on how to use them -->
1414

15+
- `TargetCategories` now supports the `STEAM_BOILER` component category. This
16+
requires `frequenz-client-common` 0.3.8 or newer. The minimum supported
17+
`grpcio` version is now 1.80.0, as required by its `frequenz-api-common`
18+
dependency.
1519
- `dispatch-cli` accepts `FREQUENZ_API_KEY` and `FREQUENZ_API_SECRET` as a
1620
fallback pair for `DISPATCH_API_AUTH_KEY` and `DISPATCH_API_SIGN_SECRET`.
1721

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ dependencies = [
3939
"typing-extensions >= 4.13.0, < 5",
4040
"frequenz-api-dispatch >= 1.0.0, < 2",
4141
"frequenz-client-base >= 0.11.0, < 0.12.0",
42-
"frequenz-client-common >= 0.3.6, < 0.4.0",
42+
"frequenz-client-common >= 0.3.8, < 0.4.0",
4343
"frequenz-core >= 1.0.2, < 2.0.0",
44-
"grpcio >= 1.72.1, < 2",
44+
"grpcio >= 1.80.0, < 2",
4545
"python-dateutil >= 2.8.2, < 3.0",
4646
]
4747
dynamic = ["version"]

‎tests/test_proto.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ def test_target_components() -> None:
5656
assert _target_components_from_protobuf(protobuf) == components
5757

5858

59+
def test_steam_boiler_target_round_trip() -> None:
60+
"""Test targeting steam boilers by their named component category."""
61+
target = TargetCategories(ElectricalComponentCategory.STEAM_BOILER)
62+
63+
protobuf = _target_components_to_protobuf(target)
64+
category = protobuf.component_categories_types.categories[0].category
65+
assert category == 19
66+
assert _target_components_from_protobuf(protobuf) == target
67+
68+
5969
def test_end_criteria() -> None:
6070
"""Test the end criteria."""
6171
for end_criteria in (

0 commit comments

Comments
 (0)