Files
WeatherService/SignalR/WeatherHub.cs
Chris Kaczor 297a2914ad - Stop storing history in memory
- Add start/end dates to history requests
- Cleanup
2015-03-29 17:57:05 -04:00

39 lines
1.4 KiB
C#

using System;
using System.Linq;
using Microsoft.AspNet.SignalR;
using System.Collections.Generic;
using WeatherService.Devices;
using WeatherService.Remote;
using WeatherService.Values;
namespace WeatherService.SignalR
{
public class WeatherHub : Hub
{
public List<DeviceBase> GetDevices()
{
return WeatherServiceCommon.GetDevices();
}
public List<KeyValuePair<DeviceBase, List<ReadingBase>>> GetGenericHistory(WeatherValueType valueType, DateTimeOffset start, DateTimeOffset end)
{
return WeatherServiceCommon.GetGenericHistory(valueType, start, end).ToList();
}
public List<KeyValuePair<string, List<WindSpeedReading>>> GetWindSpeedHistory(int groupIntervalMinutes, DateTimeOffset start, DateTimeOffset end)
{
return WeatherServiceCommon.GetWindSpeedHistory(groupIntervalMinutes, start, end).ToList();
}
public List<KeyValuePair<string, int>> GetWindDirectionHistory(DateTimeOffset start, DateTimeOffset end)
{
return WeatherServiceCommon.GetWindDirectionHistory(start, end).ToList();
}
public List<KeyValuePair<string, List<ReadingBase>>> GetDailySummary(WeatherValueType valueType, int deviceId, DateTime startDate, DateTime endDate)
{
return WeatherServiceCommon.GetDailySummary(valueType, deviceId, startDate, endDate).ToList();
}
}
}