77
88import frequenz .client .microgrid as client
99from frequenz .client .microgrid import ComponentCategory
10- from frequenz .quantities import Current , Power , Quantity
10+ from frequenz .quantities import Current , Power , Quantity , ReactivePower
1111from pytest_mock import MockerFixture
1212
1313import frequenz .sdk .microgrid .component_graph as gr
@@ -211,7 +211,7 @@ async def test_grid_reactive_power_1(mocker: MockerFixture) -> None:
211211 grid ._formula_pool ._namespace , # pylint: disable=protected-access
212212 mockgrid .meter_ids [0 ],
213213 client .ComponentMetricId .REACTIVE_POWER ,
214- Power . from_watts ,
214+ ReactivePower . from_volt_amperes_reactive ,
215215 )
216216
217217 for count in range (10 ):
@@ -222,7 +222,7 @@ async def test_grid_reactive_power_1(mocker: MockerFixture) -> None:
222222 assert (
223223 val is not None
224224 and val .value is not None
225- and val .value .as_watts () != 0.0
225+ and val .value .as_volt_amperes_reactive () != 0.0
226226 )
227227 grid_meter_data .append (val .value )
228228
@@ -255,7 +255,7 @@ async def test_grid_reactive_power_2(mocker: MockerFixture) -> None:
255255 grid ._formula_pool ._namespace , # pylint: disable=protected-access
256256 component_id ,
257257 client .ComponentMetricId .REACTIVE_POWER ,
258- Power . from_watts ,
258+ ReactivePower . from_volt_amperes_reactive ,
259259 )
260260 for component_id in [
261261 * mockgrid .meter_ids ,
@@ -275,9 +275,9 @@ async def test_grid_reactive_power_2(mocker: MockerFixture) -> None:
275275 assert (
276276 val is not None
277277 and val .value is not None
278- and val .value .as_watts () != 0.0
278+ and val .value .as_volt_amperes_reactive () != 0.0
279279 )
280- meter_sum += val .value .as_watts ()
280+ meter_sum += val .value .as_volt_amperes_reactive ()
281281
282282 val = await grid_power_recv .receive ()
283283 assert val is not None and val .value is not None
0 commit comments