From 9334aab7208a206629d4e944cee48804e607058e Mon Sep 17 00:00:00 2001 From: Sahas Subramanian Date: Tue, 22 Apr 2025 14:47:38 +0200 Subject: [PATCH 1/2] Don't start `PVSystemBoundsTracker` in locations without PV Without this, it was hard to create `PVPool`s at locations without PV. Signed-off-by: Sahas Subramanian --- .../pv_pool/_pv_pool_reference_store.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py b/src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py index 261de7fd4..d912bd5b4 100644 --- a/src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py +++ b/src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py @@ -97,15 +97,20 @@ def __init__( # pylint: disable=too-many-arguments name=f"System Bounds for PV inverters: {component_ids}", resend_latest=True, ) - self.bounds_tracker: PVSystemBoundsTracker = PVSystemBoundsTracker( - self.component_ids, - self.status_receiver, - self.bounds_channel.new_sender(), - ) - self.bounds_tracker.start() + + self.bounds_tracker: PVSystemBoundsTracker | None = None + # In locations without PV inverters, the bounds tracker will not be started. + if self.component_ids: + self.bounds_tracker = PVSystemBoundsTracker( + self.component_ids, + self.status_receiver, + self.bounds_channel.new_sender(), + ) + self.bounds_tracker.start() async def stop(self) -> None: """Stop all tasks and channels owned by the PVInverterPool.""" await self.formula_pool.stop() - await self.bounds_tracker.stop() + if self.bounds_tracker is not None: + await self.bounds_tracker.stop() self.status_receiver.close() From 5f4d157a1a4dd9629940a0bfbdd33bccf27cd626 Mon Sep 17 00:00:00 2001 From: Sahas Subramanian Date: Fri, 9 May 2025 11:38:10 +0200 Subject: [PATCH 2/2] Update release notes Signed-off-by: Sahas Subramanian --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cf471e1dd..961a42e67 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,3 +22,5 @@ | Battery | 0.0 | | PV | Minimum power (aka max production power) | | EV Chargers | Maximum power (aka max consumption power) | + +- PV Pool instances can now be created in sites without any PV. This allows for writing generic code that works for all locations, that depends on the PV power formula, for example.