mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-25 09:35:39 -05:00
Add some initial history APIs
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using ChrisKaczor.HomeMonitor.Weather.Models;
|
||||
using ChrisKaczor.HomeMonitor.Weather.Models;
|
||||
using ChrisKaczor.HomeMonitor.Weather.Service.Data;
|
||||
using ChrisKaczor.HomeMonitor.Weather.Service.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -30,5 +31,11 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
||||
{
|
||||
return (await _database.GetReadingHistory(start, end)).ToList();
|
||||
}
|
||||
|
||||
[HttpGet("value-history")]
|
||||
public async Task<ActionResult<List<WeatherValue>>> GetValueHistory(WeatherValueType weatherValueType, DateTimeOffset start, DateTimeOffset end, int bucketMinutes = 2)
|
||||
{
|
||||
return (await _database.GetReadingValueHistory(weatherValueType, start, end, bucketMinutes)).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user