Skip to content

Commit a33c709

Browse files
committed
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 <[email protected]>
1 parent d593bfd commit a33c709

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tests/utils/component_data_wrapper.py

Lines changed: 25 additions & 1 deletion
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)