Refactoring

This commit is contained in:
2019-09-30 17:54:47 -04:00
parent 89df5efe5a
commit 5b64470d1f
35 changed files with 484 additions and 485 deletions

View File

@@ -1,7 +0,0 @@
import { LaundryStatus } from './laundry-status';
describe('LaundryStatus', () => {
it('should create an instance', () => {
expect(new LaundryStatus()).toBeTruthy();
});
});

View File

@@ -1,4 +0,0 @@
export class LaundryStatus {
washer = false;
dryer = false;
}

View File

@@ -3,10 +3,10 @@ import { TestBed } from '@angular/core/testing';
import { LaundryService } from './laundry.service';
describe('LaundryService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: LaundryService = TestBed.get(LaundryService);
expect(service).toBeTruthy();
});
it('should be created', () => {
const service: LaundryService = TestBed.get(LaundryService);
expect(service).toBeTruthy();
});
});

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
import { Socket } from 'ngx-socket-io';
import { LaundryStatus } from './laundry-status';
import { LaundryStatus } from '../../models/laundry/laundry-status';
@Injectable({
providedIn: 'root'
@@ -14,11 +14,11 @@ export class LaundryService {
const newStatus: LaundryStatus = JSON.parse(statusString);
if (newStatus.washer !== undefined) {
this.latestStatus.value.washer = newStatus.washer;
this.latestStatus.value.washer = newStatus.washer;
}
if (newStatus.dryer !== undefined) {
this.latestStatus.value.dryer = newStatus.dryer;
this.latestStatus.value.dryer = newStatus.dryer;
}
});

View File

@@ -1,7 +0,0 @@
import { WeatherReading } from './weather-reading';
describe('WeatherReading', () => {
it('should create an instance', () => {
expect(new WeatherReading()).toBeTruthy();
});
});

View File

@@ -1,19 +0,0 @@
export class WeatherReading {
Type: string;
Message: null;
Timestamp: Date;
WindDirection: string;
WindSpeed: number;
Humidity: number;
HumidityTemperature: number;
Rain: number;
Pressure: number;
PressureTemperature: number;
BatteryLevel: number;
LightLevel: number;
Latitude: number;
Longitude: number;
Altitude: number;
SatelliteCount: number;
GpsTimestamp: Date;
}

View File

@@ -1,4 +0,0 @@
export class WeatherValue {
bucket: string;
averageValue: number;
}

View File

@@ -3,10 +3,10 @@ import { TestBed } from '@angular/core/testing';
import { WeatherService } from './weather.service';
describe('WeatherService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: WeatherService = TestBed.get(WeatherService);
expect(service).toBeTruthy();
});
it('should be created', () => {
const service: WeatherService = TestBed.get(WeatherService);
expect(service).toBeTruthy();
});
});

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
import { HubConnectionBuilder, HubConnection } from '@aspnet/signalr';
import { WeatherReading } from './weather-reading';
import { WeatherReading } from '../../models/weather/weather-reading';
@Injectable({
providedIn: 'root'