mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-22 09:35:39 -05:00
Add aggregate API and fix (hack) time bucket
This commit is contained in:
@@ -38,4 +38,10 @@ public class ReadingsController(Database database) : ControllerBase
|
||||
{
|
||||
return (await database.GetReadingsHistoryGrouped(start, end, bucketMinutes)).ToList();
|
||||
}
|
||||
|
||||
[HttpGet("aggregate")]
|
||||
public async Task<ActionResult<List<ReadingsAggregate>>> GetAggregate(DateTimeOffset start, DateTimeOffset end)
|
||||
{
|
||||
return (await database.GetReadingsAggregate(start, end)).ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user