Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
Added steam boiler component category.

## Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ requires-python = ">= 3.11, < 4"
dependencies = [
"typing-extensions >= 4.13.0, < 5",
"frequenz-api-assets >= 0.1.0, < 0.2.0",
"frequenz-api-common >= 0.8.0, < 1",
"frequenz-api-common >= 0.8.2, < 1",
"frequenz-client-base >= 0.11.0, < 0.12.0",
"frequenz-client-common >= 0.3.6, < 0.4.0",
"grpcio >= 1.73.1, < 2",
Expand Down
2 changes: 2 additions & 0 deletions src/frequenz/client/assets/electrical_component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
UnspecifiedComponent,
)
from ._static_transfer_switch import StaticTransferSwitch
from ._steam_boiler import SteamBoiler
from ._uninterruptible_power_supply import UninterruptiblePowerSupply
from ._wind_turbine import WindTurbine

Expand Down Expand Up @@ -91,6 +92,7 @@
"MismatchedCategoryComponent",
"UnrecognizedComponent",
"UnspecifiedComponent",
"SteamBoiler",
"StaticTransferSwitch",
"UninterruptiblePowerSupply",
"WindTurbine",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ class ElectricalComponentCategory(enum.Enum):

WIND_TURBINE = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_WIND_TURBINE
"""A wind turbine."""

STEAM_BOILER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_STEAM_BOILER
"""A steam boiler."""
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from ._precharger import Precharger
from ._problematic import UnrecognizedComponent, UnspecifiedComponent
from ._static_transfer_switch import StaticTransferSwitch
from ._steam_boiler import SteamBoiler
from ._types import ElectricalComponentType
from ._uninterruptible_power_supply import UninterruptiblePowerSupply
from ._wind_turbine import WindTurbine
Expand Down Expand Up @@ -219,6 +220,7 @@ def electrical_component_from_proto_with_issues(
| ElectricalComponentCategory.PRECHARGER
| ElectricalComponentCategory.BREAKER
| ElectricalComponentCategory.PLC
| ElectricalComponentCategory.STEAM_BOILER
| ElectricalComponentCategory.STATIC_TRANSFER_SWITCH
| ElectricalComponentCategory.UNINTERRUPTIBLE_POWER_SUPPLY
| ElectricalComponentCategory.CAPACITOR_BANK
Expand Down Expand Up @@ -416,6 +418,7 @@ def _trivial_category_to_class(
| Precharger
| Breaker
| Plc
| SteamBoiler
| StaticTransferSwitch
| UninterruptiblePowerSupply
| CapacitorBank
Expand All @@ -433,6 +436,7 @@ def _trivial_category_to_class(
ElectricalComponentCategory.PRECHARGER: Precharger,
ElectricalComponentCategory.BREAKER: Breaker,
ElectricalComponentCategory.PLC: Plc,
ElectricalComponentCategory.STEAM_BOILER: SteamBoiler,
ElectricalComponentCategory.STATIC_TRANSFER_SWITCH: StaticTransferSwitch,
ElectricalComponentCategory.UNINTERRUPTIBLE_POWER_SUPPLY: UninterruptiblePowerSupply,
ElectricalComponentCategory.CAPACITOR_BANK: CapacitorBank,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# License: MIT
# Copyright © 2026 Frequenz Energy-as-a-Service GmbH

"""Steam boiler component."""

import dataclasses
from typing import Literal

from ._category import ElectricalComponentCategory
from ._electrical_component import ElectricalComponent


@dataclasses.dataclass(frozen=True, kw_only=True)
class SteamBoiler(ElectricalComponent):
"""A steam boiler."""

category: Literal[ElectricalComponentCategory.STEAM_BOILER] = (
ElectricalComponentCategory.STEAM_BOILER
)
"""The category of this component."""
2 changes: 2 additions & 0 deletions src/frequenz/client/assets/electrical_component/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
UnspecifiedComponent,
)
from ._static_transfer_switch import StaticTransferSwitch
from ._steam_boiler import SteamBoiler
from ._uninterruptible_power_supply import UninterruptiblePowerSupply
from ._wind_turbine import WindTurbine

Expand Down Expand Up @@ -60,6 +61,7 @@
| Precharger
| Breaker
| Plc
| SteamBoiler
| StaticTransferSwitch
| UninterruptiblePowerSupply
| CapacitorBank
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# License: MIT
# Copyright © 2026 Frequenz Energy-as-a-Service GmbH

"""Test data for successful electrical component listing."""

from typing import Any

from frequenz.api.assets.v1 import assets_pb2
from frequenz.api.common.v1alpha8.microgrid.electrical_components import (
electrical_components_pb2,
)
from frequenz.client.common.microgrid import MicrogridId
from frequenz.client.common.microgrid.electrical_components import ElectricalComponentId

from frequenz.client.assets.electrical_component import SteamBoiler


def assert_stub_method_call(stub_method: Any) -> None:
"""Assert that the gRPC request matches the expected request."""
stub_method.assert_called_once_with(
assets_pb2.ListMicrogridElectricalComponentsRequest(microgrid_id=1234),
timeout=60.0,
)


client_args = (1234,)
grpc_response = assets_pb2.ListMicrogridElectricalComponentsResponse(
components=[
electrical_components_pb2.ElectricalComponent(
id=1,
microgrid_id=1234,
category=electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_STEAM_BOILER,
name="Steam Boiler",
)
]
)


def assert_client_result(result: Any) -> None:
"""Assert that the client result matches the expected component list."""
assert list(result) == [
SteamBoiler(
id=ElectricalComponentId(1),
microgrid_id=MicrogridId(1234),
name="Steam Boiler",
manufacturer=None,
model_name=None,
)
]
Loading