Skip to content

Commit 09932bd

Browse files
Add TemperatureMetrics to timeseries.battery_pool
Signed-off-by: Christian Parpart <[email protected]>
1 parent 0e5efed commit 09932bd

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/frequenz/sdk/timeseries/battery_pool/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
"""Manage a pool of batteries."""
55

6-
from ._result_types import Bound, PowerMetrics
6+
from ._result_types import Bound, PowerMetrics, TemperatureMetrics
77
from .battery_pool import BatteryPool
88

99
__all__ = [
1010
"BatteryPool",
1111
"PowerMetrics",
12+
"TemperatureMetrics",
1213
"Bound",
1314
]

src/frequenz/sdk/timeseries/battery_pool/_metric_calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ...microgrid import connection_manager
1414
from ...microgrid.component import ComponentCategory, ComponentMetricId, InverterType
15-
from ...timeseries import Energy, Percentage, Sample
15+
from ...timeseries import Energy, Percentage, Sample, Temperature
1616
from ._component_metrics import ComponentMetricsData
1717
from ._result_types import Bound, PowerMetrics
1818

src/frequenz/sdk/timeseries/battery_pool/_result_types.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from dataclasses import dataclass, field
77
from datetime import datetime
88

9+
from ...timeseries import Temperature
10+
911

1012
@dataclass
1113
class Bound:
@@ -61,3 +63,20 @@ class PowerMetrics:
6163
)
6264
```
6365
"""
66+
67+
68+
@dataclass
69+
class TemperatureMetrics:
70+
"""Container for temperature metrics."""
71+
72+
timestamp: datetime
73+
"""Timestamp of the metrics."""
74+
75+
max: Temperature
76+
"""Maximum temperature of the collection of temperatures."""
77+
78+
min: Temperature
79+
"""Minimum temperature of the collection of temperatures."""
80+
81+
avg: Temperature
82+
"""Average temperature of the collection of temperatures."""

0 commit comments

Comments
 (0)