mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-25 17:24:03 -05:00
Refactoring
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
import { LaundryStatus } from './laundry-status';
|
||||
|
||||
describe('LaundryStatus', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new LaundryStatus()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,4 +0,0 @@
|
||||
export class LaundryStatus {
|
||||
washer = false;
|
||||
dryer = false;
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { WeatherReading } from './weather-reading';
|
||||
|
||||
describe('WeatherReading', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new WeatherReading()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export class WeatherValue {
|
||||
bucket: string;
|
||||
averageValue: number;
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user