Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions src/frequenz/client/assets/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ class Location:

@staticmethod
def from_protobuf(pb: PBLocation) -> "Location":
"""
Create a Location instance from a protobuf message.
"""Create a Location instance from a protobuf message.

Args:
pb: The protobuf Location message.
Expand All @@ -85,32 +84,32 @@ class Microgrid:
A microgrid is a localized group of electricity sources and loads that normally
operates connected to and synchronous with the traditional wide area electrical
grid (macrogrid), but is able to disconnect from the grid and operate autonomously.

Attributes:
id: Unique identifier for the microgrid.
enterprise_id: ID of the enterprise that owns this microgrid.
name: Human-readable name for the microgrid.
delivery_area_code: Code identifying the delivery area.
delivery_area_code_type: Type of delivery area code.
latitude: Geographic latitude coordinate.
longitude: Geographic longitude coordinate.
country_code: ISO country code where the microgrid is located.
status: Current operational status of the microgrid.
create_time: Timestamp when the microgrid was created.
"""

id: MicrogridId
"""Unique identifier for the microgrid."""

enterprise_id: EnterpriseId
"""ID of the enterprise that owns this microgrid."""

name: str
"""Human-readable name for the microgrid."""

delivery_area: DeliveryArea | None
"""Delivery area served by the microgrid, if applicable."""

location: Location | None
"""Geographical location of the microgrid, if applicable."""

status: int
"""Current operational status of the microgrid, represented as an integer."""

create_time: datetime
"""Timestamp when the microgrid was created, in UTC."""

@staticmethod
def from_protobuf(pb: PBMicrogrid) -> "Microgrid":
"""
Create a Microgrid instance from a protobuf message.
"""Create a Microgrid instance from a protobuf message.

Args:
pb: The protobuf Microgrid message.
Expand Down
Loading