Skip to content

Commit 851f4b8

Browse files
committed
Use abc.Set for component_ids in EVChargerPool
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent a1ab925 commit 851f4b8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def producer(self) -> Producer:
157157

158158
def ev_charger_pool(
159159
self,
160-
ev_charger_ids: set[int] | None = None,
160+
ev_charger_ids: abc.Set[int] | None = None,
161161
) -> EVChargerPool:
162162
"""Return the corresponding EVChargerPool instance for the given ids.
163163
@@ -355,7 +355,7 @@ def producer() -> Producer:
355355
return _get().producer()
356356

357357

358-
def ev_charger_pool(ev_charger_ids: set[int] | None = None) -> EVChargerPool:
358+
def ev_charger_pool(ev_charger_ids: abc.Set[int] | None = None) -> EVChargerPool:
359359
"""Return the corresponding EVChargerPool instance for the given ids.
360360
361361
If an EVChargerPool instance for the given ids doesn't exist, a new one is

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(
7777
self,
7878
channel_registry: ChannelRegistry,
7979
resampler_subscription_sender: Sender[ComponentMetricRequest],
80-
component_ids: set[int] | None = None,
80+
component_ids: abc.Set[int] | None = None,
8181
repeat_interval: timedelta = timedelta(seconds=3.0),
8282
) -> None:
8383
"""Create an `EVChargerPool` instance.
@@ -103,7 +103,7 @@ def __init__(
103103
self._resampler_subscription_sender: Sender[ComponentMetricRequest] = (
104104
resampler_subscription_sender
105105
)
106-
self._component_ids: set[int] = set()
106+
self._component_ids: abc.Set[int] = set()
107107
if component_ids is not None:
108108
self._component_ids = component_ids
109109
else:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from __future__ import annotations
77

88
import asyncio
9+
from collections import abc
910
from enum import Enum
1011

1112
from frequenz.channels import Receiver
@@ -79,7 +80,7 @@ def is_ev_connected(self) -> bool:
7980
class StateTracker:
8081
"""A class for keeping track of the states of all EV Chargers in a pool."""
8182

82-
def __init__(self, component_ids: set[int]) -> None:
83+
def __init__(self, component_ids: abc.Set[int]) -> None:
8384
"""Create a `_StateTracker` instance.
8485
8586
Args:

0 commit comments

Comments
 (0)