From d593bfdc193f23861afa0853afdfa06e1a39d308 Mon Sep 17 00:00:00 2001 From: Matthias Wende Date: Fri, 12 Apr 2024 11:35:14 +0200 Subject: [PATCH 1/3] Update to frequenz-client-microgrid v0.3 Signed-off-by: Matthias Wende --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 63a85a4af..ba7fd516c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ # changing the version # (plugins.mkdocstrings.handlers.python.import) "frequenz-channels >= 1.0.0-rc1, < 2.0.0", - "frequenz-client-microgrid >= 0.2.0, < 0.3.0", + "frequenz-client-microgrid >= 0.3.0, < 0.4.0", "google-api-python-client >= 2.71, < 3", "grpcio >= 1.54.2, < 2", "grpcio-tools >= 1.54.2, < 2", From a33c70999eebb8324d520990920212ee31dfc5b3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 12 Apr 2024 09:07:17 -0300 Subject: [PATCH 2/3] Add missing reactive power to tests The microgrid API client 0.3.0 introduces reactive power to the `InverterData`, `MeterData` and `EvChargerData` classes. This commit adds the missing reactive power. Signed-off-by: Leandro Lucarella --- tests/utils/component_data_wrapper.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/utils/component_data_wrapper.py b/tests/utils/component_data_wrapper.py index f39176236..11f9dacff 100644 --- a/tests/utils/component_data_wrapper.py +++ b/tests/utils/component_data_wrapper.py @@ -111,6 +111,12 @@ def __init__( # pylint: disable=too-many-arguments active_power_exclusion_lower_bound: float = math.nan, active_power_inclusion_upper_bound: float = math.nan, active_power_exclusion_upper_bound: float = math.nan, + reactive_power: float = math.nan, + reactive_power_per_phase: tuple[float, float, float] = ( + math.nan, + math.nan, + math.nan, + ), frequency: float = 50.0, _component_state: inverter_pb.ComponentState.ValueType = ( inverter_pb.ComponentState.COMPONENT_STATE_UNSPECIFIED @@ -133,6 +139,8 @@ def __init__( # pylint: disable=too-many-arguments active_power_exclusion_lower_bound=active_power_exclusion_lower_bound, active_power_inclusion_upper_bound=active_power_inclusion_upper_bound, active_power_exclusion_upper_bound=active_power_exclusion_upper_bound, + reactive_power=reactive_power, + reactive_power_per_phase=reactive_power_per_phase, _component_state=_component_state, frequency=frequency, _errors=_errors if _errors else [], @@ -157,7 +165,7 @@ def copy_with_new_timestamp(self, new_timestamp: datetime) -> InverterDataWrappe class EvChargerDataWrapper(EVChargerData): """Wrapper for the EvChargerData with default arguments.""" - def __init__( # pylint: disable=too-many-arguments + def __init__( # pylint: disable=too-many-arguments,too-many-locals self, component_id: int, timestamp: datetime, @@ -173,6 +181,12 @@ def __init__( # pylint: disable=too-many-arguments active_power_exclusion_lower_bound: float = math.nan, active_power_inclusion_upper_bound: float = math.nan, active_power_exclusion_upper_bound: float = math.nan, + reactive_power: float = math.nan, + reactive_power_per_phase: tuple[float, float, float] = ( + math.nan, + math.nan, + math.nan, + ), frequency: float = 50.0, cable_state: EVChargerCableState = EVChargerCableState.UNSPECIFIED, component_state: EVChargerComponentState = EVChargerComponentState.UNSPECIFIED, @@ -193,6 +207,8 @@ def __init__( # pylint: disable=too-many-arguments active_power_exclusion_lower_bound=active_power_exclusion_lower_bound, active_power_inclusion_upper_bound=active_power_inclusion_upper_bound, active_power_exclusion_upper_bound=active_power_exclusion_upper_bound, + reactive_power=reactive_power, + reactive_power_per_phase=reactive_power_per_phase, frequency=frequency, cable_state=cable_state, component_state=component_state, @@ -227,6 +243,12 @@ def __init__( # pylint: disable=too-many-arguments math.nan, math.nan, ), + reactive_power: float = math.nan, + reactive_power_per_phase: tuple[float, float, float] = ( + math.nan, + math.nan, + math.nan, + ), current_per_phase: tuple[float, float, float] = (math.nan, math.nan, math.nan), voltage_per_phase: tuple[float, float, float] = (math.nan, math.nan, math.nan), frequency: float = math.nan, @@ -241,6 +263,8 @@ def __init__( # pylint: disable=too-many-arguments timestamp=timestamp, active_power=active_power, active_power_per_phase=active_power_per_phase, + reactive_power=reactive_power, + reactive_power_per_phase=reactive_power_per_phase, current_per_phase=current_per_phase, voltage_per_phase=voltage_per_phase, frequency=frequency, From dc0f9c97d54a28ee0a8374bc9154754511490ee9 Mon Sep 17 00:00:00 2001 From: Matthias Wende Date: Fri, 12 Apr 2024 11:38:15 +0200 Subject: [PATCH 3/3] Update release notes Signed-off-by: Matthias Wende --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3ccdef852..1fa4db131 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -26,6 +26,8 @@ Another notable change is the microgrid API client being moved to its own [repos - A PV pool (`PVPool`/`microgrid.pv_pool()`) was added, with `propose_power`, `power_status` and `power` methods similar to Battery and EV pools. +- The microgrid API client now exposes the reactive power for inverters, meters and EV chargers. + ## Enhancements - Warning messages are logged when multiple instances of `*Pool`s are created for the same set of batteries, with the same priority values.