Skip to content

Commit c0e5a24

Browse files
committed
fix(client): Update type hints in Microgrid class for better clarity
- Changed type hints for `delivery_area` and `location` attributes in the `Microgrid` class to support `DeliveryArea | None` and `Location | None`. - This modification enhances type safety and improves code readability. Signed-off-by: eduardiazf <[email protected]>
1 parent 74c6691 commit c0e5a24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/frequenz/client/assets/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ def from_protobuf(pb: PBMicrogrid) -> "Microgrid":
119119
Returns:
120120
A new Microgrid instance populated with data from the protobuf message.
121121
"""
122-
delivery_area: DeliveryArea = None
122+
delivery_area: DeliveryArea | None = None
123123
if pb.HasField("delivery_area"):
124124
delivery_area = DeliveryArea.from_protobuf(pb.delivery_area)
125125

126-
location: Location = None
126+
location: Location | None = None
127127
if pb.HasField("location"):
128128
location = Location.from_protobuf(pb.location)
129129

0 commit comments

Comments
 (0)