Skip to content

Commit b97f220

Browse files
Fix producer formula test
The test was incorectly reading from the chp directly although there was a meter in front of it, which should have been found first in the search. We have removed the creation of the chp meter such that the test now runs correctly. Signed-off-by: Matthias Wende <[email protected]>
1 parent 1418d7d commit b97f220

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/timeseries/test_logical_meter.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,12 @@ async def test_producer_power_no_pv_no_consumer_meter(
324324
) -> None:
325325
"""Test the producer power formula without pv and without consumer meter."""
326326
mockgrid = MockMicrogrid(grid_meter=False)
327-
mockgrid.add_chps(1)
327+
mockgrid.add_chps(1, True)
328328
await mockgrid.start(mocker)
329329

330330
logical_meter = microgrid.logical_meter()
331331
producer_power_receiver = logical_meter.producer_power.new_receiver()
332332

333-
# As there is only one meter in the microgrid, the formula interprets it
334-
# as main meter instead of chp meter, so it reads the power from the
335-
# chp component directly.
336333
await mockgrid.mock_resampler.send_chp_power([2.0])
337334
assert (await producer_power_receiver.receive()).value == Power.from_watts(2.0)
338335

0 commit comments

Comments
 (0)