Skip to content

Commit 57337df

Browse files
authoredApr 12, 2024··
Update microgrid client to v0.3 (#925)
2 parents d5cb853 + dc0f9c9 commit 57337df

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
 

‎RELEASE_NOTES.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Another notable change is the microgrid API client being moved to its own [repos
2626

2727
- A PV pool (`PVPool`/`microgrid.pv_pool()`) was added, with `propose_power`, `power_status` and `power` methods similar to Battery and EV pools.
2828

29+
- The microgrid API client now exposes the reactive power for inverters, meters and EV chargers.
30+
2931
## Enhancements
3032

3133
- Warning messages are logged when multiple instances of `*Pool`s are created for the same set of batteries, with the same priority values.

‎pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies = [
3131
# changing the version
3232
# (plugins.mkdocstrings.handlers.python.import)
3333
"frequenz-channels >= 1.0.0-rc1, < 2.0.0",
34-
"frequenz-client-microgrid >= 0.2.0, < 0.3.0",
34+
"frequenz-client-microgrid >= 0.3.0, < 0.4.0",
3535
"google-api-python-client >= 2.71, < 3",
3636
"grpcio >= 1.54.2, < 2",
3737
"grpcio-tools >= 1.54.2, < 2",

‎tests/utils/component_data_wrapper.py

+25-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ def __init__( # pylint: disable=too-many-arguments
111111
active_power_exclusion_lower_bound: float = math.nan,
112112
active_power_inclusion_upper_bound: float = math.nan,
113113
active_power_exclusion_upper_bound: float = math.nan,
114+
reactive_power: float = math.nan,
115+
reactive_power_per_phase: tuple[float, float, float] = (
116+
math.nan,
117+
math.nan,
118+
math.nan,
119+
),
114120
frequency: float = 50.0,
115121
_component_state: inverter_pb.ComponentState.ValueType = (
116122
inverter_pb.ComponentState.COMPONENT_STATE_UNSPECIFIED
@@ -133,6 +139,8 @@ def __init__( # pylint: disable=too-many-arguments
133139
active_power_exclusion_lower_bound=active_power_exclusion_lower_bound,
134140
active_power_inclusion_upper_bound=active_power_inclusion_upper_bound,
135141
active_power_exclusion_upper_bound=active_power_exclusion_upper_bound,
142+
reactive_power=reactive_power,
143+
reactive_power_per_phase=reactive_power_per_phase,
136144
_component_state=_component_state,
137145
frequency=frequency,
138146
_errors=_errors if _errors else [],
@@ -157,7 +165,7 @@ def copy_with_new_timestamp(self, new_timestamp: datetime) -> InverterDataWrappe
157165
class EvChargerDataWrapper(EVChargerData):
158166
"""Wrapper for the EvChargerData with default arguments."""
159167

160-
def __init__( # pylint: disable=too-many-arguments
168+
def __init__( # pylint: disable=too-many-arguments,too-many-locals
161169
self,
162170
component_id: int,
163171
timestamp: datetime,
@@ -173,6 +181,12 @@ def __init__( # pylint: disable=too-many-arguments
173181
active_power_exclusion_lower_bound: float = math.nan,
174182
active_power_inclusion_upper_bound: float = math.nan,
175183
active_power_exclusion_upper_bound: float = math.nan,
184+
reactive_power: float = math.nan,
185+
reactive_power_per_phase: tuple[float, float, float] = (
186+
math.nan,
187+
math.nan,
188+
math.nan,
189+
),
176190
frequency: float = 50.0,
177191
cable_state: EVChargerCableState = EVChargerCableState.UNSPECIFIED,
178192
component_state: EVChargerComponentState = EVChargerComponentState.UNSPECIFIED,
@@ -193,6 +207,8 @@ def __init__( # pylint: disable=too-many-arguments
193207
active_power_exclusion_lower_bound=active_power_exclusion_lower_bound,
194208
active_power_inclusion_upper_bound=active_power_inclusion_upper_bound,
195209
active_power_exclusion_upper_bound=active_power_exclusion_upper_bound,
210+
reactive_power=reactive_power,
211+
reactive_power_per_phase=reactive_power_per_phase,
196212
frequency=frequency,
197213
cable_state=cable_state,
198214
component_state=component_state,
@@ -227,6 +243,12 @@ def __init__( # pylint: disable=too-many-arguments
227243
math.nan,
228244
math.nan,
229245
),
246+
reactive_power: float = math.nan,
247+
reactive_power_per_phase: tuple[float, float, float] = (
248+
math.nan,
249+
math.nan,
250+
math.nan,
251+
),
230252
current_per_phase: tuple[float, float, float] = (math.nan, math.nan, math.nan),
231253
voltage_per_phase: tuple[float, float, float] = (math.nan, math.nan, math.nan),
232254
frequency: float = math.nan,
@@ -241,6 +263,8 @@ def __init__( # pylint: disable=too-many-arguments
241263
timestamp=timestamp,
242264
active_power=active_power,
243265
active_power_per_phase=active_power_per_phase,
266+
reactive_power=reactive_power,
267+
reactive_power_per_phase=reactive_power_per_phase,
244268
current_per_phase=current_per_phase,
245269
voltage_per_phase=voltage_per_phase,
246270
frequency=frequency,

0 commit comments

Comments
 (0)
Please sign in to comment.