mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-24 09:35:39 -05:00
Display app improvements
- Add summary page - Use common time range component
This commit is contained in:
@@ -4,9 +4,10 @@ import { HubConnectionBuilder, HubConnection } from '@aspnet/signalr';
|
||||
import { WeatherUpdate } from 'src/app/models/weather/weather-update';
|
||||
import { WeatherValue } from 'src/app/models/weather/weather-value';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { WeatherValueType } from 'src/app/models/weather/weather-value-type';
|
||||
import { WeatherAggregates } from 'src/app/models/weather/weather-aggregates';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import { WeatherValueType } from 'src/app/models/weather/weather-value-type';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -39,4 +40,13 @@ export class WeatherService {
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async getReadingAggregate(start: moment.Moment, end: moment.Moment): Promise<WeatherAggregates> {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
const data = await this.httpClient.get<WeatherAggregates>(`/api/weather/readings/aggregate?start=${startString}&end=${endString}`).toPromise();
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user