-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove pi api key for weather and ipGeolocation * Add local weather * Add settings and allow hide pages * Add piSensor for collecting data on Rasp-pi with DHT11 * Change port for nginx * Fix missing arguments * Fix missing argument for sleep * Fix media type for put request * Add autostart script * Update README.md to include piSensor
- Loading branch information
Showing
39 changed files
with
814 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
VERSION='0.0.9' | ||
VERSION='0.1.0-beta' | ||
OPEN_WEATHER_API='YOUR-KEY-GOES-HERE' | ||
PI_API='324cj2io3WRjrc' | ||
PI_API="a10d052a-4133-4e50-80e8-b8e1adb2f7c6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
NG_APP_PI_API=$PI_API | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
NG_APP_PI_API=$PI_API | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export class Settings { | ||
display: { | ||
weatherDefault: { | ||
show: boolean; | ||
index: number; | ||
}; | ||
weatherHourly: { | ||
show: boolean; | ||
index: number; | ||
}; | ||
weatherDaily: { | ||
show: boolean; | ||
index: number; | ||
}; | ||
weatherLocal: { | ||
show: boolean; | ||
index: number; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,11 @@ | |
font-size: 4vh; | ||
} | ||
|
||
.btn { | ||
line-height: 0; | ||
} | ||
|
||
#nav-bar { | ||
z-index: 10000; | ||
position: relative; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<div | ||
class="modal fade" | ||
id="staticBackdrop" | ||
data-backdrop="static" | ||
data-keyboard="false" | ||
tabindex="-1" | ||
aria-labelledby="staticBackdropLabel" | ||
aria-hidden="true" | ||
> | ||
<div class="modal-dialog"> | ||
<div class="modal-content bg-dark"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="staticBackdropLabel">Settings</h5> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<h5>Display</h5> | ||
<div class="form-check"> | ||
<input | ||
class="form-check-input" | ||
type="checkbox" | ||
value="" | ||
id="weather-default" | ||
[checked]="settings.display.weatherDefault.show" | ||
(change)="settings.display.weatherDefault.show = !settings.display.weatherDefault.show" | ||
/> | ||
<label class="form-check-label" for="weather-default"> Weather Default </label> | ||
</div> | ||
<div class="form-check"> | ||
<input | ||
class="form-check-input" | ||
type="checkbox" | ||
value="" | ||
id="weather-hourly" | ||
[checked]="settings.display.weatherHourly.show" | ||
(change)="settings.display.weatherHourly.show = !settings.display.weatherHourly.show" | ||
/> | ||
<label class="form-check-label" for="weather-hourly"> Weather Hourly </label> | ||
</div> | ||
<div class="form-check"> | ||
<input | ||
class="form-check-input" | ||
type="checkbox" | ||
value="" | ||
id="weather-daily" | ||
[checked]="settings.display.weatherDaily.show" | ||
(change)="settings.display.weatherDaily.show = !settings.display.weatherDaily.show" | ||
/> | ||
<label class="form-check-label" for="weather-daily"> Weather Daily </label> | ||
</div> | ||
<div class="form-check"> | ||
<input | ||
class="form-check-input" | ||
type="checkbox" | ||
value="" | ||
id="weather-local" | ||
[checked]="settings.display.weatherLocal.show" | ||
(change)="settings.display.weatherLocal.show = !settings.display.weatherLocal.show" | ||
/> | ||
<label class="form-check-label" for="weather-local"> Weather Local </label> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> | ||
<button type="button" class="btn btn-primary" (click)="save()">Save</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { SettingsComponent } from './settings.component'; | ||
|
||
describe('SettingsComponent', () => { | ||
let component: SettingsComponent; | ||
let fixture: ComponentFixture<SettingsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [SettingsComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(SettingsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { CookieService } from 'ngx-cookie-service'; | ||
import { Settings } from '../model/settings'; | ||
|
||
@Component({ | ||
selector: 'app-settings', | ||
templateUrl: './settings.component.html', | ||
styleUrls: ['./settings.component.css'], | ||
}) | ||
export class SettingsComponent implements OnInit { | ||
settings: Settings; | ||
|
||
constructor(private cookieService: CookieService) {} | ||
|
||
ngOnInit(): void { | ||
const settingsString = this.cookieService.get('settings'); | ||
this.settings = JSON.parse(settingsString); | ||
} | ||
|
||
save(): void { | ||
this.cookieService.set('settings', JSON.stringify(this.settings)); | ||
window.location.reload(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
31 changes: 31 additions & 0 deletions
31
piClient/src/app/weather/weather-local/weather-local.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div class="d-flex align-self-stretch justify-content-center" style="height: calc(100% - 5px)"> | ||
<div | ||
class="d-flex flex-column align-self-stretch align-items-middle w-100 p-4" | ||
*ngIf="!weatherResponseLoading; else loading" | ||
> | ||
<div class="row row-cols-2"> | ||
<div class="col mb-4" *ngIf="localWeatherResponse.responseStatus === 'SUCCESS'"> | ||
<div class="card"> | ||
<div class="card-body bg-dark"> | ||
<h5 class="card-title display-6 bg">{{ localWeatherResponse.weather.description }}</h5> | ||
<p class="m-0 display-5"> | ||
{{ localWeatherResponse.weather.temp.toFixed(0).replace('-0', '0') }}℃ / | ||
{{ localWeatherResponse.weather.humidity.toFixed(0).replace('-0', '0') }}% | ||
</p> | ||
</div> | ||
<div class="card-footer bg-secondary"> | ||
<small>{{ localWeatherResponse.responseMessage }}</small> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<ng-template #loading> | ||
<div class="d-flex flex-column justify-content-center"> | ||
<div class="spinner-grow text-light mx-auto" style="width: 3rem; height: 3rem" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div class="mx-auto" *ngIf="errorMessage !== undefined">{{ errorMessage }}</div> | ||
</div> | ||
</ng-template> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
piClient/src/app/weather/weather-local/weather-local.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { WeatherLocalComponent } from './weather-local.component'; | ||
|
||
describe('WeatherLocalComponent', () => { | ||
let component: WeatherLocalComponent; | ||
let fixture: ComponentFixture<WeatherLocalComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [WeatherLocalComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(WeatherLocalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.