2017-09-20 14:31:06 +03:00
|
|
|
import { Component, OnDestroy } from '@angular/core';
|
2017-08-01 17:42:21 +03:00
|
|
|
import { NbThemeService } from '@nebular/theme';
|
2017-07-06 19:10:31 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-temperature',
|
|
|
|
|
styleUrls: ['./temperature.component.scss'],
|
2017-07-10 16:35:55 +03:00
|
|
|
templateUrl: './temperature.component.html',
|
2017-07-06 19:10:31 +03:00
|
|
|
})
|
2017-09-20 14:31:06 +03:00
|
|
|
export class TemperatureComponent implements OnDestroy {
|
2017-07-06 22:33:06 +03:00
|
|
|
|
2017-10-20 17:31:36 +03:00
|
|
|
temperature = 24;
|
|
|
|
|
temperatureOff = false;
|
2017-07-10 16:35:55 +03:00
|
|
|
temperatureMode = 'cool';
|
|
|
|
|
|
2017-10-20 17:31:36 +03:00
|
|
|
humidity = 87;
|
|
|
|
|
humidityOff = false;
|
2017-07-13 16:00:49 +03:00
|
|
|
humidityMode = 'heat';
|
2017-07-07 19:54:49 +03:00
|
|
|
|
2017-08-01 15:42:06 +03:00
|
|
|
colors: any;
|
2017-09-20 14:31:06 +03:00
|
|
|
themeSubscription: any;
|
2017-07-06 22:33:06 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
constructor(private theme: NbThemeService) {
|
2017-09-20 14:31:06 +03:00
|
|
|
this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
|
2017-08-01 15:42:06 +03:00
|
|
|
this.colors = config.variables;
|
2017-07-06 22:33:06 +03:00
|
|
|
});
|
|
|
|
|
}
|
2017-09-20 14:31:06 +03:00
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|
this.themeSubscription.unsubscribe();
|
|
|
|
|
}
|
2017-07-06 19:10:31 +03:00
|
|
|
}
|