|
| 1 | +# License: MIT |
| 2 | +# Copyright © 2026 Frequenz Energy-as-a-Service GmbH |
| 3 | + |
| 4 | +"""Manages shared state/tasks for a set of steam boilers.""" |
| 5 | + |
| 6 | +import uuid |
| 7 | +from typing import Type |
| 8 | + |
| 9 | +from frequenz.client.microgrid.component import ( |
| 10 | + Component, |
| 11 | + SteamBoiler, # TODO client 0.19.1 needed, under review |
| 12 | +) |
| 13 | +from typing_extensions import override |
| 14 | + |
| 15 | +from ..component_pool._component_pool_reference_store import ComponentPoolReferenceStore |
| 16 | + |
| 17 | + |
| 18 | +class SteamBoilerPoolReferenceStore(ComponentPoolReferenceStore): |
| 19 | + """A class for maintaining the shared state/tasks for a set of pools of steam boilers. |
| 20 | +
|
| 21 | + This includes ownership of |
| 22 | + - the formula pool and metric calculators. |
| 23 | + - the tasks for calculating system bounds for the steam boilers. |
| 24 | +
|
| 25 | + These are independent of the priority of the actors and can be shared between |
| 26 | + multiple users of the same set of steam boilers. |
| 27 | +
|
| 28 | + They are exposed through the SteamBoilerPool class. |
| 29 | + """ |
| 30 | + |
| 31 | + @staticmethod |
| 32 | + def get_component_class() -> Type[Component]: |
| 33 | + """Class of the component type.""" |
| 34 | + return SteamBoiler |
| 35 | + |
| 36 | + @staticmethod |
| 37 | + def get_pool_type_name() -> str: |
| 38 | + """Name of the pool type, for display purposes.""" |
| 39 | + return "SteamBoilerPool" |
| 40 | + |
| 41 | + @staticmethod |
| 42 | + def get_component_type_name_plural() -> str: |
| 43 | + """Name of the component type, for display purposes.""" |
| 44 | + return "steam boilers" |
| 45 | + |
| 46 | + @override |
| 47 | + def get_namespace(self) -> str: |
| 48 | + """Namespace to use with the data pipeline.""" |
| 49 | + return f"steam-boiler-pool-{uuid.uuid4()}" |
| 50 | + |
| 51 | + @override |
| 52 | + def create_bounds_tracker(self) -> None: |
| 53 | + """Create the bounds tracker for the pool.""" |
0 commit comments