mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
Add aggregate API
This commit is contained in:
@@ -32,6 +32,14 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
||||
return (await _database.GetReadingHistory(start, end)).ToList();
|
||||
}
|
||||
|
||||
[HttpGet("aggregate")]
|
||||
public async Task<ActionResult<WeatherAggregate>> GetHistoryAggregate(DateTimeOffset start, DateTimeOffset end)
|
||||
{
|
||||
var readings = await _database.GetReadingHistory(start, end);
|
||||
|
||||
return new WeatherAggregate(readings);
|
||||
}
|
||||
|
||||
[HttpGet("value-history")]
|
||||
public async Task<ActionResult<List<WeatherValue>>> GetValueHistory(WeatherValueType weatherValueType, DateTimeOffset start, DateTimeOffset end)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user