Skip to content

Commit 1a52351

Browse files
committed
Update PowerDistributor to support PV inverters
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 6be3ac4 commit 1a52351

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/frequenz/sdk/actor/power_distributing/power_distributing.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
import asyncio
1616

1717
from frequenz.channels import Receiver, Sender
18-
from frequenz.client.microgrid import ComponentCategory, ComponentType
18+
from frequenz.client.microgrid import ComponentCategory, ComponentType, InverterType
1919

2020
from ...actor._actor import Actor
21-
from ._component_managers import BatteryManager, ComponentManager, EVChargerManager
21+
from ._component_managers import (
22+
BatteryManager,
23+
ComponentManager,
24+
EVChargerManager,
25+
PVManager,
26+
)
2227
from ._component_status import ComponentPoolStatus
2328
from .request import Request
2429
from .result import Result
@@ -102,6 +107,13 @@ def __init__( # pylint: disable=too-many-arguments
102107
self._component_manager = EVChargerManager(
103108
component_pool_status_sender, results_sender
104109
)
110+
elif (
111+
component_category == ComponentCategory.INVERTER
112+
and component_type == InverterType.SOLAR
113+
):
114+
self._component_manager = PVManager(
115+
component_pool_status_sender, results_sender
116+
)
105117
else:
106118
raise ValueError(
107119
f"PowerDistributor doesn't support controlling: {component_category}"

0 commit comments

Comments
 (0)