mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-18 17:23:37 -05:00
Data model simplification
This commit is contained in:
@@ -106,7 +106,7 @@ export class PowerChartsComponent implements OnInit {
|
||||
|
||||
data[1].forEach(dataElement => {
|
||||
const date = Date.parse(dataElement.bucket);
|
||||
seriesData[2].data.push([date, dataElement.averageValue * 100]);
|
||||
seriesData[2].data.push([date, dataElement.averageValue]);
|
||||
});
|
||||
|
||||
const title = this.selectedTimeSpan === TimeSpan.Last24Hours ? this.timeSpanItems[TimeSpan.Last24Hours] : this.getSelectedDateDisplayString();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WeatherReading } from 'src/app/models/weather/weather-reading';
|
||||
import { WeatherUpdate } from 'src/app/models/weather/weather-update';
|
||||
import { WeatherService } from 'src/app/services/weather/weather.service';
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'moment-duration-format';
|
||||
})
|
||||
export class AlmanacComponent implements OnInit {
|
||||
public loaded = false;
|
||||
public latestReading: WeatherReading;
|
||||
public latestReading: WeatherUpdate;
|
||||
public sunTimes: SunCalc.GetTimesResult;
|
||||
public moonTimes: SunCalc.GetMoonTimes;
|
||||
public moon: SunCalc.GetMoonIlluminationResult;
|
||||
|
||||
@@ -118,10 +118,10 @@ export class WeatherChartsComponent implements OnInit {
|
||||
|
||||
data.forEach(dataElement => {
|
||||
const date = Date.parse(dataElement.bucket);
|
||||
seriesData[0].data.push([date, dataElement.averagePressureTemperature]);
|
||||
seriesData[0].data.push([date, dataElement.averageTemperature]);
|
||||
seriesData[1].data.push([date, dataElement.averagePressure / 33.864 / 100]);
|
||||
seriesData[2].data.push([date, dataElement.averageHumidity]);
|
||||
seriesData[3].data.push([date, dataElement.averageLightLevel * 100]);
|
||||
seriesData[3].data.push([date, dataElement.averageLightLevel]);
|
||||
seriesData[4].data.push([date, dataElement.rainTotal]);
|
||||
});
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
Temperature
|
||||
</td>
|
||||
<td>
|
||||
{{ latestReading.PressureTemperature.toFixed(2) }}°F
|
||||
{{ latestReading.Temperature.toFixed(2) }}°F
|
||||
</td>
|
||||
</tr>
|
||||
<tr *ngIf="latestReading.HeatIndex">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WeatherReading } from 'src/app/models/weather/weather-reading';
|
||||
import { WeatherUpdate } from 'src/app/models/weather/weather-update';
|
||||
import { WeatherService } from 'src/app/services/weather/weather.service';
|
||||
|
||||
@Component({
|
||||
@@ -8,7 +8,7 @@ import { WeatherService } from 'src/app/services/weather/weather.service';
|
||||
styleUrls: ['./weather-current.component.scss']
|
||||
})
|
||||
export class WeatherCurrentComponent implements OnInit {
|
||||
public latestReading: WeatherReading;
|
||||
public latestReading: WeatherUpdate;
|
||||
|
||||
constructor(private weatherService: WeatherService) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user