mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
Add API for recent power
This commit is contained in:
@@ -19,6 +19,12 @@ namespace ChrisKaczor.HomeMonitor.Power.Service.Controllers
|
||||
_database = database;
|
||||
}
|
||||
|
||||
[HttpGet("recent")]
|
||||
public async Task<ActionResult<PowerStatus>> GetRecent()
|
||||
{
|
||||
return await _database.GetRecentStatus();
|
||||
}
|
||||
|
||||
[HttpGet("history-grouped")]
|
||||
public async Task<ActionResult<List<PowerStatusGrouped>>> GetHistoryGrouped(DateTimeOffset start, DateTimeOffset end, int bucketMinutes = 2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user