@@ -170,8 +170,8 @@ async def list_single_component_data(
170170 microgrid_id : int ,
171171 component_id : int ,
172172 metrics : Metric | list [Metric ],
173- start_dt : datetime ,
174- end_dt : datetime ,
173+ start_dt : datetime | None ,
174+ end_dt : datetime | None ,
175175 resampling_period : timedelta | None ,
176176 include_states : bool = False ,
177177 include_bounds : bool = False ,
@@ -182,8 +182,8 @@ async def list_single_component_data(
182182 microgrid_id: The microgrid ID.
183183 component_id: The component ID.
184184 metrics: The metric name or list of metric names.
185- start_dt: The start date and time.
186- end_dt: The end date and time.
185+ start_dt: start datetime, if None, the earliest available data will be used
186+ end_dt: end datetime, if None starts streaming indefinitely from start_dt
187187 resampling_period: The period for resampling the data.
188188 include_states: Whether to include the state data.
189189 include_bounds: Whether to include the bound data.
@@ -211,8 +211,8 @@ async def list_microgrid_components_data(
211211 * ,
212212 microgrid_components : list [tuple [int , list [int ]]],
213213 metrics : Metric | list [Metric ],
214- start_dt : datetime ,
215- end_dt : datetime ,
214+ start_dt : datetime | None ,
215+ end_dt : datetime | None ,
216216 resampling_period : timedelta | None ,
217217 include_states : bool = False ,
218218 include_bounds : bool = False ,
@@ -223,8 +223,8 @@ async def list_microgrid_components_data(
223223 microgrid_components: List of tuples where each tuple contains
224224 microgrid ID and corresponding component IDs.
225225 metrics: The metric name or list of metric names.
226- start_dt: The start date and time.
227- end_dt: The end date and time.
226+ start_dt: start datetime, if None, the earliest available data will be used
227+ end_dt: end datetime, if None starts streaming indefinitely from start_dt
228228 resampling_period: The period for resampling the data.
229229 include_states: Whether to include the state data.
230230 include_bounds: Whether to include the bound data.
@@ -256,8 +256,8 @@ async def _list_microgrid_components_data_batch(
256256 * ,
257257 microgrid_components : list [tuple [int , list [int ]]],
258258 metrics : list [Metric ],
259- start_dt : datetime ,
260- end_dt : datetime ,
259+ start_dt : datetime | None ,
260+ end_dt : datetime | None ,
261261 resampling_period : timedelta | None ,
262262 include_states : bool = False ,
263263 include_bounds : bool = False ,
@@ -270,8 +270,8 @@ async def _list_microgrid_components_data_batch(
270270 Args:
271271 microgrid_components: A list of tuples of microgrid IDs and component IDs.
272272 metrics: A list of metrics.
273- start_dt: The start date and time.
274- end_dt: The end date and time.
273+ start_dt: start datetime, if None, the earliest available data will be used
274+ end_dt: end datetime, if None starts streaming indefinitely from start_dt
275275 resampling_period: The period for resampling the data.
276276 include_states: Whether to include the state data.
277277 include_bounds: Whether to include the bound data.
@@ -290,8 +290,8 @@ def dt2ts(dt: datetime) -> PBTimestamp:
290290 return ts
291291
292292 time_filter = PBTimeFilter (
293- start = dt2ts (start_dt ),
294- end = dt2ts (end_dt ),
293+ start = dt2ts (start_dt ) if start_dt else None ,
294+ end = dt2ts (end_dt ) if end_dt else None ,
295295 )
296296
297297 incl_states = (
0 commit comments