Start to reorganize

This commit is contained in:
2019-09-29 22:08:21 -04:00
parent aee51c8a15
commit 89df5efe5a
92 changed files with 15494 additions and 544 deletions

View File

@@ -0,0 +1,24 @@
<div class="laundry-current">
<div *ngIf="latestStatus === null">
Loading...
</div>
<div *ngIf="latestStatus !== null">
<table>
<tr>
<td class="laundry-current-header">
Washer
</td>
<td [ngClass]="latestStatus.washer.toString()">
{{ latestStatus.washer ? 'On' : 'Off' }}
</td>
</tr>
<tr>
<td class="laundry-current-header">
Dryer
</td>
<td [ngClass]="latestStatus.dryer.toString()">
{{ latestStatus.dryer ? 'On' : 'Off' }}
</td>
</tr>
</table>
</div>

View File

@@ -0,0 +1,17 @@
.laundry-current {
font-size: 14px;
}
.laundry-current-header {
font-weight: 500;
text-align: right;
padding-right: 10px;
}
.true {
color: darkgoldenrod;
}
.false {
color: darkgreen;
}

View File

@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LaundryComponent } from './laundry.component';
describe('LaundryComponent', () => {
let component: LaundryComponent;
let fixture: ComponentFixture<LaundryComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LaundryComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LaundryComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,17 @@
import { Component, OnInit } from '@angular/core';
import { LaundryService } from '../../services/laundry/laundry.service';
import { LaundryStatus } from '../../services/laundry/laundry-status';
@Component({
selector: 'app-laundry',
templateUrl: './laundry.component.html',
styleUrls: ['./laundry.component.scss']
})
export class LaundryComponent implements OnInit {
public latestStatus: LaundryStatus;
constructor(private laundryService: LaundryService) { }
ngOnInit() {
this.laundryService.getLatestStatus().subscribe(s => this.latestStatus = s);
}
}