Skip to content

Commit f0d14ce

Browse files
committed
Add an EVChargerPool.stop method
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent c9fa07e commit f0d14ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ async def set_bounds(self, component_id: int, max_amps: float) -> None:
179179
self._bounds_setter = BoundsSetter(self._repeat_interval)
180180
await self._bounds_setter.set(component_id, max_amps)
181181

182+
async def stop(self) -> None:
183+
"""Stop all tasks and channels owned by the EVChargerPool."""
184+
if self._bounds_setter:
185+
await self._bounds_setter.stop()
186+
if self._state_tracker:
187+
await self._state_tracker.stop()
188+
182189
async def _get_current_streams(
183190
self, component_id: int
184191
) -> tuple[Receiver[Sample], Receiver[Sample], Receiver[Sample]]:

0 commit comments

Comments
 (0)