44"""A highlevel interface for the reporting API."""
55
66from collections import namedtuple
7- from datetime import datetime
7+ from datetime import datetime , timedelta
88
99from frequenz .client .common .metric import Metric
1010from frequenz .client .reporting import ReportingApiClient
@@ -24,7 +24,7 @@ async def cumulative_energy(
2424 start_time : datetime ,
2525 end_time : datetime ,
2626 use_active_power : bool ,
27- resolution : int | None = None ,
27+ resampling_period : timedelta | None ,
2828) -> CumulativeEnergy :
2929 """
3030 Calculate the cumulative energy consumption and production over a specified time range.
@@ -37,8 +37,7 @@ async def cumulative_energy(
3737 end_time: The end date and time for the period.
3838 use_active_power: If True, use the 'AC_ACTIVE_POWER' metric.
3939 If False, use the 'AC_ACTIVE_ENERGY' metric.
40- resolution: The resampling resolution for the data, represented in seconds.
41- If None, no resampling is applied.
40+ resampling_period: The period for resampling the data.If None, no resampling is applied.
4241 Returns:
4342 EnergyMetric: A named tuple with start_time, end_time, consumption, and production
4443 in Wh. Consumption has a positive sign, production has a negative sign.
@@ -52,7 +51,7 @@ async def cumulative_energy(
5251 metrics = metric ,
5352 start_dt = start_time ,
5453 end_dt = end_time ,
55- resolution = resolution ,
54+ resampling_period = resampling_period ,
5655 )
5756 ]
5857
0 commit comments