Skip to content

Commit ee58cde

Browse files
authored
Update bound-streaming channels to resend latest to new receivers (#1098)
The `SystemBoundsTracker`s send out a new value only when there's a change in the system bounds. This means when a new receiver is created, it could wait for a long time before receiving the bounds. This change allows new receivers to get the latest state when requested. This is already the case for battery bounds, and needed only for PV and EV charger bounds.
2 parents 998ebff + 6d0f658 commit ee58cde

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

RELEASE_NOTES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030

3131
## Bug Fixes
3232

33-
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
33+
- Fixes an issue where PV and EV system bounds were not available to the Power Manager sometimes when requested after startup.

src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool_reference_store.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ def __init__( # pylint: disable=too-many-arguments
9393
)
9494

9595
self.bounds_channel: Broadcast[SystemBounds] = Broadcast(
96-
name=f"System Bounds for EV Chargers: {component_ids}"
96+
name=f"System Bounds for EV Chargers: {component_ids}",
97+
resend_latest=True,
9798
)
9899
self.bounds_tracker: EVCSystemBoundsTracker = EVCSystemBoundsTracker(
99100
self.component_ids,

src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def __init__( # pylint: disable=too-many-arguments
9494
self.resampler_subscription_sender,
9595
)
9696
self.bounds_channel: Broadcast[SystemBounds] = Broadcast(
97-
name=f"System Bounds for PV inverters: {component_ids}"
97+
name=f"System Bounds for PV inverters: {component_ids}",
98+
resend_latest=True,
9899
)
99100
self.bounds_tracker: PVSystemBoundsTracker = PVSystemBoundsTracker(
100101
self.component_ids,

0 commit comments

Comments
 (0)