Skip to content

electrical_component

frequenz.client.assets.electrical_component ¤

Electrical component types.

Classes¤

frequenz.client.assets.electrical_component.AcEvCharger dataclass ¤

Bases: EvCharger

An EV charger that supports AC charging only.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class AcEvCharger(EvCharger):
    """An EV charger that supports AC charging only."""

    type: Literal[EvChargerType.AC] = EvChargerType.AC
    """The type of this EV charger.

    Note:
        This should not be used normally, you should test if a EV charger
        [`isinstance`][] of a concrete component class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new EV charger type yet (i.e. for use with
        [`UnrecognizedEvCharger`][frequenz.client.assets.electrical_component.UnrecognizedEvCharger]).
    """
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete EV charger class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤
type: Literal[AC] = AC

The type of this EV charger.

Note

This should not be used normally, you should test if a EV charger isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new EV charger type yet (i.e. for use with UnrecognizedEvCharger).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is EvCharger:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.BatteryInverter dataclass ¤

Bases: Inverter

A battery inverter.

Source code in frequenz/client/assets/electrical_component/_inverter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class BatteryInverter(Inverter):
    """A battery inverter."""

    type: Literal[InverterType.BATTERY] = InverterType.BATTERY
    """The type of this inverter.

    Note:
        This should not be used normally, you should test if a inverter
        [`isinstance`][] of a concrete inverter class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new inverter type yet (i.e. for use with
        [`UnrecognizedInverter`][frequenz.client.assets.electrical_component.UnrecognizedInverter]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[INVERTER] = INVERTER

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this inverter.

Note

This should not be used normally, you should test if a inverter isinstance of a concrete inverter class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new inverter type yet (i.e. for use with UnrecognizedInverter).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_inverter.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Inverter:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.BatteryType ¤

Bases: Enum

The known types of batteries.

Source code in frequenz/client/assets/electrical_component/_battery.py
@enum.unique
class BatteryType(enum.Enum):
    """The known types of batteries."""

    UNSPECIFIED = electrical_components_pb2.BATTERY_TYPE_UNSPECIFIED
    """The battery type is unspecified."""

    LI_ION = electrical_components_pb2.BATTERY_TYPE_LI_ION
    """Lithium-ion (Li-ion) battery."""

    NA_ION = electrical_components_pb2.BATTERY_TYPE_NA_ION
    """Sodium-ion (Na-ion) battery."""
Attributes¤
LI_ION class-attribute instance-attribute ¤
LI_ION = BATTERY_TYPE_LI_ION

Lithium-ion (Li-ion) battery.

NA_ION class-attribute instance-attribute ¤
NA_ION = BATTERY_TYPE_NA_ION

Sodium-ion (Na-ion) battery.

UNSPECIFIED class-attribute instance-attribute ¤
UNSPECIFIED = BATTERY_TYPE_UNSPECIFIED

The battery type is unspecified.

frequenz.client.assets.electrical_component.Breaker dataclass ¤

Bases: ElectricalComponent

A breaker component.

Source code in frequenz/client/assets/electrical_component/_breaker.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Breaker(ElectricalComponent):
    """A breaker component."""

    category: Literal[ElectricalComponentCategory.BREAKER] = (
        ElectricalComponentCategory.BREAKER
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[BREAKER] = BREAKER

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.CapacitorBank dataclass ¤

Bases: ElectricalComponent

A capacitor bank component.

Source code in frequenz/client/assets/electrical_component/_capacitor_bank.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class CapacitorBank(ElectricalComponent):
    """A capacitor bank component."""

    category: Literal[ElectricalComponentCategory.CAPACITOR_BANK] = (
        ElectricalComponentCategory.CAPACITOR_BANK
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.Chp dataclass ¤

Bases: ElectricalComponent

A combined heat and power (CHP) component.

Source code in frequenz/client/assets/electrical_component/_chp.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Chp(ElectricalComponent):
    """A combined heat and power (CHP) component."""

    category: Literal[ElectricalComponentCategory.CHP] = ElectricalComponentCategory.CHP
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[CHP] = CHP

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.Converter dataclass ¤

Bases: ElectricalComponent

An AC-DC converter component.

Source code in frequenz/client/assets/electrical_component/_converter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Converter(ElectricalComponent):
    """An AC-DC converter component."""

    category: Literal[ElectricalComponentCategory.CONVERTER] = (
        ElectricalComponentCategory.CONVERTER
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.CryptoMiner dataclass ¤

Bases: ElectricalComponent

A crypto miner component.

Source code in frequenz/client/assets/electrical_component/_crypto_miner.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class CryptoMiner(ElectricalComponent):
    """A crypto miner component."""

    category: Literal[ElectricalComponentCategory.CRYPTO_MINER] = (
        ElectricalComponentCategory.CRYPTO_MINER
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.DcEvCharger dataclass ¤

Bases: EvCharger

An EV charger that supports DC charging only.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class DcEvCharger(EvCharger):
    """An EV charger that supports DC charging only."""

    type: Literal[EvChargerType.DC] = EvChargerType.DC
    """The type of this EV charger.

    Note:
        This should not be used normally, you should test if a EV charger
        [`isinstance`][] of a concrete component class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new EV charger type yet (i.e. for use with
        [`UnrecognizedEvCharger`][frequenz.client.assets.electrical_component.UnrecognizedEvCharger]).
    """
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete EV charger class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤
type: Literal[DC] = DC

The type of this EV charger.

Note

This should not be used normally, you should test if a EV charger isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new EV charger type yet (i.e. for use with UnrecognizedEvCharger).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is EvCharger:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.ElectricalComponent dataclass ¤

A wrapper class for the protobuf ElectricalComponent message.

An electrical component is a physical device that can be used to generate or consume electricity.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
@dataclass(frozen=True, kw_only=True)
class ElectricalComponent:  # pylint: disable=too-many-instance-attributes
    """A wrapper class for the protobuf ElectricalComponent message.

    An electrical component is a physical device that can be used to generate or consume
    electricity.
    """

    id: ElectricalComponentId
    """Unique identifier for the electrical component."""

    microgrid_id: MicrogridId
    """Unique identifier for the microgrid that the electrical component belongs to."""

    name: str | None = None
    """Human-readable name for the electrical component."""

    category: ElectricalComponentCategory | int
    """The component category. E.g., Inverter, Battery, etc."""

    manufacturer: str | None = None
    """The manufacturer of the electrical component."""

    model_name: str | None = None
    """The model name of the electrical component."""

    operational_lifetime: Lifetime = dataclasses.field(default_factory=Lifetime)
    """The operational lifetime of the electrical component."""

    rated_bounds: Mapping[Metric | int, Bounds] = dataclasses.field(
        default_factory=dict,
        # dict is not hashable, so we don't use this field to calculate the hash. This
        # shouldn't be a problem since it is very unlikely that two components with all
        # other attributes being equal would have different category specific metadata,
        # so hash collisions should be still very unlikely.
        hash=False,
    )
    """List of rated bounds present for the component identified by Metric."""

    def __new__(cls, *_: Any, **__: Any) -> Self:
        """Prevent instantiation of this class."""
        if cls is ElectricalComponent:
            raise TypeError(f"Cannot instantiate {cls.__name__} directly")
        return super().__new__(cls)

    @property
    def identity(self) -> tuple[ElectricalComponentId, MicrogridId]:
        """The identity of this component.

        This uses the electrical component ID and microgrid ID to identify a component
        without considering the other attributes, so even if a component state
        changed, the identity remains the same.
        """
        return (self.id, self.microgrid_id)

    def __str__(self) -> str:
        """Return the ID of this electrical component as a string."""
        name = f":{self.name}" if self.name else ""
        return f"{self.id}{name}"
Attributes¤
category instance-attribute ¤

The component category. E.g., Inverter, Battery, etc.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.ElectricalComponentCategory ¤

Bases: Enum

The known categories of components that can be present in a microgrid.

Source code in frequenz/client/assets/electrical_component/_category.py
@enum.unique
class ElectricalComponentCategory(enum.Enum):
    """The known categories of components that can be present in a microgrid."""

    UNSPECIFIED = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_UNSPECIFIED
    """The component category is unspecified, probably due to an error in the message."""

    GRID = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_GRID_CONNECTION_POINT
    """The point where the local microgrid is connected to the grid."""

    METER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_METER
    """A meter, for measuring electrical metrics, e.g., current, voltage, etc."""

    INVERTER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_INVERTER
    """An electricity generator, with batteries or solar energy."""

    BREAKER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_BREAKER
    """A breaker, used to interrupt the flow of electricity."""

    CONVERTER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_CONVERTER
    """A DC-DC converter."""

    BATTERY = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_BATTERY
    """A storage system for electrical energy, used by inverters."""

    EV_CHARGER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_EV_CHARGER
    """A station for charging electrical vehicles."""

    CRYPTO_MINER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_CRYPTO_MINER
    """A crypto miner."""

    ELECTROLYZER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_ELECTROLYZER
    """An electrolyzer for converting water into hydrogen and oxygen."""

    CHP = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_CHP
    """A heat and power combustion plant (CHP stands for combined heat and power)."""

    PRECHARGER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_PRECHARGER
    """A precharge module.

    Precharging involves gradually ramping up the DC voltage to prevent any
    potential damage to sensitive electrical components like capacitors.

    While many inverters and batteries come equipped with in-built precharging
    mechanisms, some may lack this feature. In such cases, we need to use
    external precharging modules.
    """

    HVAC = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_HVAC
    """A Heating, Ventilation, and Air Conditioning (HVAC) system."""

    POWER_TRANSFORMER = (
        electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_POWER_TRANSFORMER
    )
    """A power transformer."""

    PLC = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_PLC
    """An industrial controller or PLC (Programmable Logic Controller)."""

    STATIC_TRANSFER_SWITCH = (
        electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_STATIC_TRANSFER_SWITCH
    )
    """A static transfer switch (STS)."""

    UNINTERRUPTIBLE_POWER_SUPPLY = (
        electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_UNINTERRUPTIBLE_POWER_SUPPLY
    )
    """An uninterruptible power supply (UPS)."""

    CAPACITOR_BANK = (
        electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_CAPACITOR_BANK
    )
    """A capacitor bank for power factor correction."""

    WIND_TURBINE = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_WIND_TURBINE
    """A wind turbine."""
Attributes¤
BATTERY class-attribute instance-attribute ¤
BATTERY = ELECTRICAL_COMPONENT_CATEGORY_BATTERY

A storage system for electrical energy, used by inverters.

BREAKER class-attribute instance-attribute ¤
BREAKER = ELECTRICAL_COMPONENT_CATEGORY_BREAKER

A breaker, used to interrupt the flow of electricity.

CAPACITOR_BANK class-attribute instance-attribute ¤
CAPACITOR_BANK = (
    ELECTRICAL_COMPONENT_CATEGORY_CAPACITOR_BANK
)

A capacitor bank for power factor correction.

CHP class-attribute instance-attribute ¤
CHP = ELECTRICAL_COMPONENT_CATEGORY_CHP

A heat and power combustion plant (CHP stands for combined heat and power).

CONVERTER class-attribute instance-attribute ¤
CONVERTER = ELECTRICAL_COMPONENT_CATEGORY_CONVERTER

A DC-DC converter.

CRYPTO_MINER class-attribute instance-attribute ¤
CRYPTO_MINER = ELECTRICAL_COMPONENT_CATEGORY_CRYPTO_MINER

A crypto miner.

ELECTROLYZER class-attribute instance-attribute ¤
ELECTROLYZER = ELECTRICAL_COMPONENT_CATEGORY_ELECTROLYZER

An electrolyzer for converting water into hydrogen and oxygen.

EV_CHARGER class-attribute instance-attribute ¤
EV_CHARGER = ELECTRICAL_COMPONENT_CATEGORY_EV_CHARGER

A station for charging electrical vehicles.

GRID class-attribute instance-attribute ¤
GRID = ELECTRICAL_COMPONENT_CATEGORY_GRID_CONNECTION_POINT

The point where the local microgrid is connected to the grid.

HVAC class-attribute instance-attribute ¤
HVAC = ELECTRICAL_COMPONENT_CATEGORY_HVAC

A Heating, Ventilation, and Air Conditioning (HVAC) system.

INVERTER class-attribute instance-attribute ¤
INVERTER = ELECTRICAL_COMPONENT_CATEGORY_INVERTER

An electricity generator, with batteries or solar energy.

METER class-attribute instance-attribute ¤
METER = ELECTRICAL_COMPONENT_CATEGORY_METER

A meter, for measuring electrical metrics, e.g., current, voltage, etc.

PLC class-attribute instance-attribute ¤
PLC = ELECTRICAL_COMPONENT_CATEGORY_PLC

An industrial controller or PLC (Programmable Logic Controller).

POWER_TRANSFORMER class-attribute instance-attribute ¤
POWER_TRANSFORMER = (
    ELECTRICAL_COMPONENT_CATEGORY_POWER_TRANSFORMER
)

A power transformer.

PRECHARGER class-attribute instance-attribute ¤
PRECHARGER = ELECTRICAL_COMPONENT_CATEGORY_PRECHARGER

A precharge module.

Precharging involves gradually ramping up the DC voltage to prevent any potential damage to sensitive electrical components like capacitors.

While many inverters and batteries come equipped with in-built precharging mechanisms, some may lack this feature. In such cases, we need to use external precharging modules.

STATIC_TRANSFER_SWITCH class-attribute instance-attribute ¤
STATIC_TRANSFER_SWITCH = (
    ELECTRICAL_COMPONENT_CATEGORY_STATIC_TRANSFER_SWITCH
)

A static transfer switch (STS).

UNINTERRUPTIBLE_POWER_SUPPLY class-attribute instance-attribute ¤
UNINTERRUPTIBLE_POWER_SUPPLY = ELECTRICAL_COMPONENT_CATEGORY_UNINTERRUPTIBLE_POWER_SUPPLY

An uninterruptible power supply (UPS).

UNSPECIFIED class-attribute instance-attribute ¤
UNSPECIFIED = ELECTRICAL_COMPONENT_CATEGORY_UNSPECIFIED

The component category is unspecified, probably due to an error in the message.

WIND_TURBINE class-attribute instance-attribute ¤
WIND_TURBINE = ELECTRICAL_COMPONENT_CATEGORY_WIND_TURBINE

A wind turbine.

frequenz.client.assets.electrical_component.Electrolyzer dataclass ¤

Bases: ElectricalComponent

An electrolyzer component.

Source code in frequenz/client/assets/electrical_component/_electrolyzer.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Electrolyzer(ElectricalComponent):
    """An electrolyzer component."""

    category: Literal[ElectricalComponentCategory.ELECTROLYZER] = (
        ElectricalComponentCategory.ELECTROLYZER
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.EvChargerType ¤

Bases: Enum

The known types of electric vehicle (EV) chargers.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
@enum.unique
class EvChargerType(enum.Enum):
    """The known types of electric vehicle (EV) chargers."""

    UNSPECIFIED = electrical_components_pb2.EV_CHARGER_TYPE_UNSPECIFIED
    """The type of the EV charger is unspecified."""

    AC = electrical_components_pb2.EV_CHARGER_TYPE_AC
    """The EV charging station supports AC charging only."""

    DC = electrical_components_pb2.EV_CHARGER_TYPE_DC
    """The EV charging station supports DC charging only."""

    HYBRID = electrical_components_pb2.EV_CHARGER_TYPE_HYBRID
    """The EV charging station supports both AC and DC."""
Attributes¤
AC class-attribute instance-attribute ¤
AC = EV_CHARGER_TYPE_AC

The EV charging station supports AC charging only.

DC class-attribute instance-attribute ¤
DC = EV_CHARGER_TYPE_DC

The EV charging station supports DC charging only.

HYBRID class-attribute instance-attribute ¤
HYBRID = EV_CHARGER_TYPE_HYBRID

The EV charging station supports both AC and DC.

UNSPECIFIED class-attribute instance-attribute ¤
UNSPECIFIED = EV_CHARGER_TYPE_UNSPECIFIED

The type of the EV charger is unspecified.

frequenz.client.assets.electrical_component.GridConnectionPoint dataclass ¤

Bases: ElectricalComponent

A point where a microgrid connects to the grid.

The terms "Grid Connection Point" and "Point of Common Coupling" (PCC) are commonly used in the context.

While both terms describe a connection point to the grid, the GridConnectionPoint is specifically the physical connection point of the generation facility to the grid, often concerned with the technical and ownership aspects of the connection.

In contrast, the PCC is is more specific in terms of electrical engineering. It refers to the point where a customer's local electrical system (such as a microgrid) connects to the utility distribution grid in such a way that it can affect other customers’ systems connected to the same network. It is the point where the grid and customer's electrical systems interface and where issues like power quality and supply regulations are assessed.

The term GridConnectionPoint is used to make it clear that what is referred to here is the physical connection point of the local facility to the grid. Note that this may also be the PCC in some cases.

Source code in frequenz/client/assets/electrical_component/_grid_connection_point.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class GridConnectionPoint(ElectricalComponent):
    """A point where a microgrid connects to the grid.

    The terms "Grid Connection Point" and "Point of Common Coupling" (PCC) are
    commonly used in the context.

    While both terms describe a connection point to the grid, the
    `GridConnectionPoint` is specifically the physical connection point of the
    generation facility to the grid, often concerned with the technical and
    ownership aspects of the connection.

    In contrast, the PCC is is more specific in terms of electrical engineering.
    It refers to the point where a customer's local electrical system (such as a
    microgrid) connects to the utility distribution grid in such a way that it
    can affect other customers’ systems connected to the same network. It is the
    point where the grid and customer's electrical systems interface and where
    issues like power quality and supply regulations are assessed.

    The term `GridConnectionPoint` is used to make it clear that what is referred
    to here is the physical connection point of the local facility to the grid.
    Note that this may also be the PCC in some cases.
    """

    category: Literal[ElectricalComponentCategory.GRID] = (
        ElectricalComponentCategory.GRID
    )
    """The category of this component."""

    rated_fuse_current: int
    """The maximum amount of electrical current that can flow through this connection, in amperes.

    The rated maximum amount of current the fuse at the grid connection point is
    designed to safely carry under normal operating conditions.

    This limit applies to currents both flowing in or out of each of the 3
    phases individually.

    In other words, a current `i`A at one of the phases of the grid connection
    point must comply with the following constraint:
    `-rated_fuse_current <= i <= rated_fuse_current`
    """

    def __post_init__(self) -> None:
        """Validate the fuse's rated current."""
        if self.rated_fuse_current < 0:
            raise ValueError(
                f"rated_fuse_current must be a positive integer, not {self.rated_fuse_current}"
            )
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[GRID] = GRID

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

rated_fuse_current instance-attribute ¤
rated_fuse_current: int

The maximum amount of electrical current that can flow through this connection, in amperes.

The rated maximum amount of current the fuse at the grid connection point is designed to safely carry under normal operating conditions.

This limit applies to currents both flowing in or out of each of the 3 phases individually.

In other words, a current iA at one of the phases of the grid connection point must comply with the following constraint: -rated_fuse_current <= i <= rated_fuse_current

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__post_init__ ¤
__post_init__() -> None

Validate the fuse's rated current.

Source code in frequenz/client/assets/electrical_component/_grid_connection_point.py
def __post_init__(self) -> None:
    """Validate the fuse's rated current."""
    if self.rated_fuse_current < 0:
        raise ValueError(
            f"rated_fuse_current must be a positive integer, not {self.rated_fuse_current}"
        )
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.Hvac dataclass ¤

Bases: ElectricalComponent

A heating, ventilation, and air conditioning (HVAC) component.

Source code in frequenz/client/assets/electrical_component/_hvac.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Hvac(ElectricalComponent):
    """A heating, ventilation, and air conditioning (HVAC) component."""

    category: Literal[ElectricalComponentCategory.HVAC] = (
        ElectricalComponentCategory.HVAC
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[HVAC] = HVAC

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.HybridEvCharger dataclass ¤

Bases: EvCharger

An EV charger that supports both AC and DC charging.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class HybridEvCharger(EvCharger):
    """An EV charger that supports both AC and DC charging."""

    type: Literal[EvChargerType.HYBRID] = EvChargerType.HYBRID
    """The type of this EV charger.

    Note:
        This should not be used normally, you should test if a EV charger
        [`isinstance`][] of a concrete component class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new EV charger type yet (i.e. for use with
        [`UnrecognizedEvCharger`][frequenz.client.assets.electrical_component.UnrecognizedEvCharger]).
    """
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete EV charger class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this EV charger.

Note

This should not be used normally, you should test if a EV charger isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new EV charger type yet (i.e. for use with UnrecognizedEvCharger).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is EvCharger:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.HybridInverter dataclass ¤

Bases: Inverter

A hybrid inverter.

Source code in frequenz/client/assets/electrical_component/_inverter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class HybridInverter(Inverter):
    """A hybrid inverter."""

    type: Literal[InverterType.HYBRID] = InverterType.HYBRID
    """The type of this inverter.

    Note:
        This should not be used normally, you should test if a inverter
        [`isinstance`][] of a concrete inverter class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new inverter type yet (i.e. for use with
        [`UnrecognizedInverter`][frequenz.client.assets.electrical_component.UnrecognizedInverter]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[INVERTER] = INVERTER

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this inverter.

Note

This should not be used normally, you should test if a inverter isinstance of a concrete inverter class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new inverter type yet (i.e. for use with UnrecognizedInverter).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_inverter.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Inverter:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.InverterType ¤

Bases: Enum

The known types of inverters.

Source code in frequenz/client/assets/electrical_component/_inverter.py
@enum.unique
class InverterType(enum.Enum):
    """The known types of inverters."""

    UNSPECIFIED = electrical_components_pb2.INVERTER_TYPE_UNSPECIFIED
    """The type of the inverter is unspecified."""

    BATTERY = electrical_components_pb2.INVERTER_TYPE_BATTERY
    """The inverter is a battery inverter."""

    PV = electrical_components_pb2.INVERTER_TYPE_PV
    """The inverter is a solar inverter."""

    HYBRID = electrical_components_pb2.INVERTER_TYPE_HYBRID
    """The inverter is a hybrid inverter."""
Attributes¤
BATTERY class-attribute instance-attribute ¤
BATTERY = INVERTER_TYPE_BATTERY

The inverter is a battery inverter.

HYBRID class-attribute instance-attribute ¤
HYBRID = INVERTER_TYPE_HYBRID

The inverter is a hybrid inverter.

PV class-attribute instance-attribute ¤
PV = INVERTER_TYPE_PV

The inverter is a solar inverter.

UNSPECIFIED class-attribute instance-attribute ¤
UNSPECIFIED = INVERTER_TYPE_UNSPECIFIED

The type of the inverter is unspecified.

frequenz.client.assets.electrical_component.LiIonBattery dataclass ¤

Bases: Battery

A Li-ion battery.

Source code in frequenz/client/assets/electrical_component/_battery.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class LiIonBattery(Battery):
    """A Li-ion battery."""

    type: Literal[BatteryType.LI_ION] = BatteryType.LI_ION
    """The type of this battery.

    Note:
        This should not be used normally, you should test if a battery
        [`isinstance`][] of a concrete battery class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new battery type yet (i.e. for use with
        [`UnrecognizedBattery`][frequenz.client.assets.electrical_component.UnrecognizedBattery]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[BATTERY] = BATTERY

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this battery.

Note

This should not be used normally, you should test if a battery isinstance of a concrete battery class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new battery type yet (i.e. for use with UnrecognizedBattery).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_battery.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Battery:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.Meter dataclass ¤

Bases: ElectricalComponent

A measuring meter component.

Source code in frequenz/client/assets/electrical_component/_meter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Meter(ElectricalComponent):
    """A measuring meter component."""

    category: Literal[ElectricalComponentCategory.METER] = (
        ElectricalComponentCategory.METER
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[METER] = METER

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.MismatchedCategoryComponent dataclass ¤

Bases: ProblematicComponent

A component with a mismatch in the category.

This component declared a category but carries category specific metadata that doesn't match the declared category.

Source code in frequenz/client/assets/electrical_component/_problematic.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class MismatchedCategoryComponent(ProblematicComponent):
    """A component with a mismatch in the category.

    This component declared a category but carries category specific metadata that
    doesn't match the declared category.
    """

    category: ElectricalComponentCategory | int
    """The category of this component."""
Attributes¤
category instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_problematic.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ProblematicComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.NaIonBattery dataclass ¤

Bases: Battery

A Na-ion battery.

Source code in frequenz/client/assets/electrical_component/_battery.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class NaIonBattery(Battery):
    """A Na-ion battery."""

    type: Literal[BatteryType.NA_ION] = BatteryType.NA_ION
    """The type of this battery.

    Note:
        This should not be used normally, you should test if a battery
        [`isinstance`][] of a concrete battery class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new battery type yet (i.e. for use with
        [`UnrecognizedBattery`][frequenz.client.assets.electrical_component.UnrecognizedBattery]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[BATTERY] = BATTERY

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this battery.

Note

This should not be used normally, you should test if a battery isinstance of a concrete battery class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new battery type yet (i.e. for use with UnrecognizedBattery).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_battery.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Battery:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.Plc dataclass ¤

Bases: ElectricalComponent

A PLC component.

Source code in frequenz/client/assets/electrical_component/_plc.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Plc(ElectricalComponent):
    """A PLC component."""

    category: Literal[ElectricalComponentCategory.PLC] = ElectricalComponentCategory.PLC
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[PLC] = PLC

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.PowerTransformer dataclass ¤

Bases: ElectricalComponent

A power transformer designed for the bulk transfer of electrical energy.

Power transformers are essential components in electrical power systems that transfer electrical energy between different voltage levels. Their primary function is to "step-up" or "step-down" voltage levels for efficient transmission and distribution of power across the electrical grid.

Source code in frequenz/client/assets/electrical_component/_power_transformer.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class PowerTransformer(ElectricalComponent):
    """A power transformer designed for the bulk transfer of electrical energy.

    Power transformers are essential components in electrical power systems that
    transfer electrical energy between different voltage levels. Their primary
    function is to "step-up" or "step-down" voltage levels for efficient
    transmission and distribution of power across the electrical grid.
    """

    category: Literal[ElectricalComponentCategory.POWER_TRANSFORMER] = (
        ElectricalComponentCategory.POWER_TRANSFORMER
    )
    """The category of this component."""

    primary_power: float
    """The primary voltage of the power transformer."""

    secondary_power: float
    """The secondary voltage of the power transformer."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

primary_power instance-attribute ¤
primary_power: float

The primary voltage of the power transformer.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

secondary_power instance-attribute ¤
secondary_power: float

The secondary voltage of the power transformer.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.Precharger dataclass ¤

Bases: ElectricalComponent

A precharger component.

Source code in frequenz/client/assets/electrical_component/_precharger.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class Precharger(ElectricalComponent):
    """A precharger component."""

    category: Literal[ElectricalComponentCategory.PRECHARGER] = (
        ElectricalComponentCategory.PRECHARGER
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.PvInverter dataclass ¤

Bases: Inverter

A PV inverter.

Source code in frequenz/client/assets/electrical_component/_inverter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class PvInverter(Inverter):
    """A PV inverter."""

    type: Literal[InverterType.PV] = InverterType.PV
    """The type of this inverter.

    Note:
        This should not be used normally, you should test if a inverter
        [`isinstance`][] of a concrete inverter class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new inverter type yet (i.e. for use with
        [`UnrecognizedInverter`][frequenz.client.assets.electrical_component.UnrecognizedInverter]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[INVERTER] = INVERTER

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤
type: Literal[PV] = PV

The type of this inverter.

Note

This should not be used normally, you should test if a inverter isinstance of a concrete inverter class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new inverter type yet (i.e. for use with UnrecognizedInverter).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_inverter.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Inverter:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.StaticTransferSwitch dataclass ¤

Bases: ElectricalComponent

A static transfer switch component.

Source code in frequenz/client/assets/electrical_component/_static_transfer_switch.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class StaticTransferSwitch(ElectricalComponent):
    """A static transfer switch component."""

    category: Literal[ElectricalComponentCategory.STATIC_TRANSFER_SWITCH] = (
        ElectricalComponentCategory.STATIC_TRANSFER_SWITCH
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UninterruptiblePowerSupply dataclass ¤

Bases: ElectricalComponent

An uninterruptible power supply component.

Source code in frequenz/client/assets/electrical_component/_uninterruptible_power_supply.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UninterruptiblePowerSupply(ElectricalComponent):
    """An uninterruptible power supply component."""

    category: Literal[ElectricalComponentCategory.UNINTERRUPTIBLE_POWER_SUPPLY] = (
        ElectricalComponentCategory.UNINTERRUPTIBLE_POWER_SUPPLY
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnrecognizedBattery dataclass ¤

Bases: Battery

A battery of an unrecognized type.

Source code in frequenz/client/assets/electrical_component/_battery.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnrecognizedBattery(Battery):
    """A battery of an unrecognized type."""

    type: int
    """The unrecognized type of this battery."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[BATTERY] = BATTERY

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type instance-attribute ¤
type: int

The unrecognized type of this battery.

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_battery.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Battery:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnrecognizedComponent dataclass ¤

Bases: ProblematicComponent

A component of an unrecognized type.

Source code in frequenz/client/assets/electrical_component/_problematic.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnrecognizedComponent(ProblematicComponent):
    """A component of an unrecognized type."""

    category: int
    """The category of this component."""
Attributes¤
category instance-attribute ¤
category: int

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_problematic.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ProblematicComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnrecognizedEvCharger dataclass ¤

Bases: EvCharger

An EV charger of an unrecognized type.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnrecognizedEvCharger(EvCharger):
    """An EV charger of an unrecognized type."""

    type: int
    """The unrecognized type of this EV charger."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete EV charger class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type instance-attribute ¤
type: int

The unrecognized type of this EV charger.

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is EvCharger:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnrecognizedInverter dataclass ¤

Bases: Inverter

An inverter component.

Source code in frequenz/client/assets/electrical_component/_inverter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnrecognizedInverter(Inverter):
    """An inverter component."""

    type: int
    """The unrecognized type of this inverter."""
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[INVERTER] = INVERTER

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type instance-attribute ¤
type: int

The unrecognized type of this inverter.

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_inverter.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Inverter:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnspecifiedBattery dataclass ¤

Bases: Battery

A battery of a unspecified type.

Source code in frequenz/client/assets/electrical_component/_battery.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnspecifiedBattery(Battery):
    """A battery of a unspecified type."""

    type: Literal[BatteryType.UNSPECIFIED] = BatteryType.UNSPECIFIED
    """The type of this battery.

    Note:
        This should not be used normally, you should test if a battery
        [`isinstance`][] of a concrete battery class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new battery type yet (i.e. for use with
        [`UnrecognizedBattery`][frequenz.client.assets.electrical_component.UnrecognizedBattery]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[BATTERY] = BATTERY

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this battery.

Note

This should not be used normally, you should test if a battery isinstance of a concrete battery class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new battery type yet (i.e. for use with UnrecognizedBattery).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_battery.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Battery:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnspecifiedComponent dataclass ¤

Bases: ProblematicComponent

A component of unspecified type.

Source code in frequenz/client/assets/electrical_component/_problematic.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnspecifiedComponent(ProblematicComponent):
    """A component of unspecified type."""

    category: Literal[ElectricalComponentCategory.UNSPECIFIED] = (
        ElectricalComponentCategory.UNSPECIFIED
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_problematic.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ProblematicComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnspecifiedEvCharger dataclass ¤

Bases: EvCharger

An EV charger of an unspecified type.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnspecifiedEvCharger(EvCharger):
    """An EV charger of an unspecified type."""

    type: Literal[EvChargerType.UNSPECIFIED] = EvChargerType.UNSPECIFIED
    """The type of this EV charger.

    Note:
        This should not be used normally, you should test if a EV charger
        [`isinstance`][] of a concrete component class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new EV charger type yet (i.e. for use with
        [`UnrecognizedEvCharger`][frequenz.client.assets.electrical_component.UnrecognizedEvCharger]).
    """
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete EV charger class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this EV charger.

Note

This should not be used normally, you should test if a EV charger isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new EV charger type yet (i.e. for use with UnrecognizedEvCharger).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_ev_charger.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is EvCharger:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.UnspecifiedInverter dataclass ¤

Bases: Inverter

An inverter of an unspecified type.

Source code in frequenz/client/assets/electrical_component/_inverter.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class UnspecifiedInverter(Inverter):
    """An inverter of an unspecified type."""

    type: Literal[InverterType.UNSPECIFIED] = InverterType.UNSPECIFIED
    """The type of this inverter.

    Note:
        This should not be used normally, you should test if a inverter
        [`isinstance`][] of a concrete inverter class instead.

        It is only provided for using with a newer version of the API where the client
        doesn't know about the new inverter type yet (i.e. for use with
        [`UnrecognizedInverter`][frequenz.client.assets.electrical_component.UnrecognizedInverter]).
    """
Attributes¤
category class-attribute instance-attribute ¤
category: Literal[INVERTER] = INVERTER

The category of this component.

Note

This should not be used normally, you should test if a component isinstance of a concrete component class instead.

It is only provided for using with a newer version of the API where the client doesn't know about a new category yet (i.e. for use with UnrecognizedComponent) and in case some low level code needs to know the category of a component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

type class-attribute instance-attribute ¤

The type of this inverter.

Note

This should not be used normally, you should test if a inverter isinstance of a concrete inverter class instead.

It is only provided for using with a newer version of the API where the client doesn't know about the new inverter type yet (i.e. for use with UnrecognizedInverter).

Functions¤
__new__ ¤
__new__(*args: Any, **kwargs: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_inverter.py
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is Inverter:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"

frequenz.client.assets.electrical_component.WindTurbine dataclass ¤

Bases: ElectricalComponent

A wind turbine component.

Source code in frequenz/client/assets/electrical_component/_wind_turbine.py
@dataclasses.dataclass(frozen=True, kw_only=True)
class WindTurbine(ElectricalComponent):
    """A wind turbine component."""

    category: Literal[ElectricalComponentCategory.WIND_TURBINE] = (
        ElectricalComponentCategory.WIND_TURBINE
    )
    """The category of this component."""
Attributes¤
category class-attribute instance-attribute ¤

The category of this component.

id instance-attribute ¤
id: ElectricalComponentId

Unique identifier for the electrical component.

identity property ¤
identity: tuple[ElectricalComponentId, MicrogridId]

The identity of this component.

This uses the electrical component ID and microgrid ID to identify a component without considering the other attributes, so even if a component state changed, the identity remains the same.

manufacturer class-attribute instance-attribute ¤
manufacturer: str | None = None

The manufacturer of the electrical component.

microgrid_id instance-attribute ¤
microgrid_id: MicrogridId

Unique identifier for the microgrid that the electrical component belongs to.

model_name class-attribute instance-attribute ¤
model_name: str | None = None

The model name of the electrical component.

name class-attribute instance-attribute ¤
name: str | None = None

Human-readable name for the electrical component.

operational_lifetime class-attribute instance-attribute ¤
operational_lifetime: Lifetime = field(
    default_factory=Lifetime
)

The operational lifetime of the electrical component.

rated_bounds class-attribute instance-attribute ¤
rated_bounds: Mapping[Metric | int, Bounds] = field(
    default_factory=dict, hash=False
)

List of rated bounds present for the component identified by Metric.

Functions¤
__new__ ¤
__new__(*_: Any, **__: Any) -> Self

Prevent instantiation of this class.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __new__(cls, *_: Any, **__: Any) -> Self:
    """Prevent instantiation of this class."""
    if cls is ElectricalComponent:
        raise TypeError(f"Cannot instantiate {cls.__name__} directly")
    return super().__new__(cls)
__str__ ¤
__str__() -> str

Return the ID of this electrical component as a string.

Source code in frequenz/client/assets/electrical_component/_electrical_component.py
def __str__(self) -> str:
    """Return the ID of this electrical component as a string."""
    name = f":{self.name}" if self.name else ""
    return f"{self.id}{name}"