Skip to content

Commit ca58539

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

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
@@ -97,6 +102,13 @@ def __init__( # pylint: disable=too-many-arguments
97102
self._component_manager = EVChargerManager(
98103
component_pool_status_sender, results_sender
99104
)
105+
elif (
106+
component_category == ComponentCategory.INVERTER
107+
and component_type == InverterType.SOLAR
108+
):
109+
self._component_manager = PVManager(
110+
component_pool_status_sender, results_sender
111+
)
100112
else:
101113
raise ValueError(
102114
f"PowerDistributor doesn't support controlling: {component_category}"

0 commit comments

Comments
 (0)