From d3eba15f1fd44215894e0b5b417d93a02006bbaf Mon Sep 17 00:00:00 2001 From: MishaZhem Date: Thu, 18 Jul 2024 18:19:01 +0300 Subject: [PATCH] chore: change climate control --- .../climate-control.component.html | 9 ++++++--- .../climate-control.component.ts | 4 ++-- .../climate-control.service.ts | 19 +++++++++++++++++++ .../data/services/climate-control.service.ts | 10 ---------- 4 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.service.ts delete mode 100644 apps/taiga-lumbermill/src/dashboards/iot/data/services/climate-control.service.ts diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html index 47371fe45..029be1116 100644 --- a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html +++ b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html @@ -12,8 +12,11 @@
- Room temperature С° - Water temperature - Air humidity, % + + {{ input.name }} +
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts index c43721055..8beb359b2 100644 --- a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts +++ b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts @@ -5,7 +5,7 @@ import {TuiAppearance, tuiNumberFormatProvider} from '@taiga-ui/core'; import {TuiCardLarge} from '@taiga-ui/layout'; import {TuiInputNumberModule, tuiInputNumberOptionsProvider} from '@taiga-ui/legacy'; -import {ClimateControlService} from '../../data/services/climate-control.service'; +import {ClimateControlService} from './climate-control.service'; @Component({ standalone: true, @@ -30,5 +30,5 @@ import {ClimateControlService} from '../../data/services/climate-control.service ], }) export class ClimateControlComponent { - protected data = inject(ClimateControlService); + protected climateControlService = inject(ClimateControlService); } diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.service.ts b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.service.ts new file mode 100644 index 000000000..727bca1a2 --- /dev/null +++ b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; + +interface ClimateControlData { + readonly name: string; + readonly value: number; +} + +export const INITIAL_DATA: ClimateControlData[] = [ + {name: 'Room temperature С°', value: 32}, + {name: 'Water temperature', value: 0}, + {name: 'Air humidity, %', value: 10}, +]; + +@Injectable({ + providedIn: 'root', +}) +export class ClimateControlService { + public readonly climateControlData = INITIAL_DATA; +} diff --git a/apps/taiga-lumbermill/src/dashboards/iot/data/services/climate-control.service.ts b/apps/taiga-lumbermill/src/dashboards/iot/data/services/climate-control.service.ts deleted file mode 100644 index aa5b9bfad..000000000 --- a/apps/taiga-lumbermill/src/dashboards/iot/data/services/climate-control.service.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {Injectable} from '@angular/core'; - -@Injectable({ - providedIn: 'root', -}) -export class ClimateControlService { - public value = 32; - public value2 = 0; - public value3 = 10; -}