Skip to content

Commit e583477

Browse files
committed
fixup! Implement GetMicrogridMetadata
Add tests for `Lifetime`.
1 parent 6d16fd7 commit e583477

File tree

2 files changed

+416
-2
lines changed

2 files changed

+416
-2
lines changed

src/frequenz/client/microgrid/_lifetime.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ def active_at(self, timestamp: datetime) -> bool:
4545
Returns:
4646
True if active at the given timestamp, False otherwise.
4747
"""
48-
# Handle start time - it's not active if start is in the future
4948
if self.start is not None and self.start > timestamp:
5049
return False
51-
# Handle end time - active up to and including end time
5250
if self.end is not None:
5351
return self.end >= timestamp
52+
# Both are None, so it is always active
5453
return True
5554

5655
@cached_property

0 commit comments

Comments
 (0)