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. 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", 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,