|
20 | 20 | from frequenz.api.microgrid.common_pb2 import AC, Metric, MetricAggregation |
21 | 21 | from frequenz.api.microgrid.ev_charger_pb2 import EVCharger |
22 | 22 | from frequenz.api.microgrid.inverter_pb2 import Inverter |
| 23 | +from frequenz.api.microgrid.inverter_pb2 import Type as InverterType |
23 | 24 | from frequenz.api.microgrid.meter_pb2 import Data as MeterData |
24 | 25 | from frequenz.api.microgrid.meter_pb2 import Meter |
25 | 26 | from frequenz.api.microgrid.microgrid_pb2 import ( |
@@ -77,10 +78,22 @@ def __init__( |
77 | 78 | self._latest_discharge: Optional[PowerLevelParam] = None |
78 | 79 |
|
79 | 80 | def add_component( |
80 | | - self, component_id: int, component_category: ComponentCategory.V |
| 81 | + self, |
| 82 | + component_id: int, |
| 83 | + component_category: ComponentCategory.V, |
| 84 | + inverter_type: InverterType.V = InverterType.TYPE_UNSPECIFIED, |
81 | 85 | ) -> None: |
82 | 86 | """Add a component to the mock service.""" |
83 | | - self._components.append(Component(id=component_id, category=component_category)) |
| 87 | + if component_category == ComponentCategory.COMPONENT_CATEGORY_INVERTER: |
| 88 | + self._components.append( |
| 89 | + Component( |
| 90 | + id=component_id, category=component_category, inverter=inverter_type |
| 91 | + ) |
| 92 | + ) |
| 93 | + else: |
| 94 | + self._components.append( |
| 95 | + Component(id=component_id, category=component_category) |
| 96 | + ) |
84 | 97 |
|
85 | 98 | def add_connection(self, start: int, end: int) -> None: |
86 | 99 | """Add a connection to the mock service.""" |
|
0 commit comments