From 7354a085189da2e5cef297f8df2ff20a4c75e0e3 Mon Sep 17 00:00:00 2001 From: NicoFR75 Date: Fri, 17 Apr 2020 16:36:33 +0200 Subject: [PATCH 1/3] Add accessories - LightSensor --- .../app/core/accessories/accessories.module.ts | 3 +++ .../lightsensor/lightsensor.component.html | 7 +++++++ .../lightsensor/lightsensor.component.scss | 0 .../types/lightsensor/lightsensor.component.ts | 17 +++++++++++++++++ .../accessories/accessories.component.html | 2 ++ .../accessories-widget.component.html | 2 ++ 6 files changed, 31 insertions(+) create mode 100644 ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html create mode 100644 ui/src/app/core/accessories/types/lightsensor/lightsensor.component.scss create mode 100644 ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts diff --git a/ui/src/app/core/accessories/accessories.module.ts b/ui/src/app/core/accessories/accessories.module.ts index fb2490f5c..9d028ea60 100644 --- a/ui/src/app/core/accessories/accessories.module.ts +++ b/ui/src/app/core/accessories/accessories.module.ts @@ -19,6 +19,7 @@ import { FanManageComponent } from './types/fan/fan.manage.component'; import { UnknownComponent } from './types/unknown/unknown.component'; import { LightbulbComponent } from './types/lightbulb/lightbulb.component'; import { LightbulbManageComponent } from './types/lightbulb/lightbulb.manage.component'; +import { LightsensorComponent } from './types/lightsensor/lightsensor.component'; import { LockmechanismComponent } from './types/lockmechanism/lockmechanism.component'; import { TemperaturesensorComponent } from './types/temperaturesensor/temperaturesensor.component'; import { GaragedooropenerComponent } from './types/garagedooropener/garagedooropener.component'; @@ -64,6 +65,7 @@ import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsy UnknownComponent, LightbulbComponent, LightbulbManageComponent, + LightsensorComponent, LockmechanismComponent, TemperaturesensorComponent, GaragedooropenerComponent, @@ -106,6 +108,7 @@ import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsy UnknownComponent, LightbulbComponent, LightbulbManageComponent, + LightsensorComponent, LockmechanismComponent, TemperaturesensorComponent, GaragedooropenerComponent, diff --git a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html new file mode 100644 index 000000000..4faadb348 --- /dev/null +++ b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html @@ -0,0 +1,7 @@ +
+
+
+
{{ service.customName || service.serviceName }}
+
{{ service.values.CurrentAmbientLightLevel }}%
+
+
\ No newline at end of file diff --git a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.scss b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts new file mode 100644 index 000000000..0553d7e1e --- /dev/null +++ b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { ServiceTypeX } from '../../accessories.interfaces'; + +@Component({ + selector: 'app-lightsensor', + templateUrl: './lightsensor.component.html', + styleUrls: ['./lightsensor.component.scss'], +}) +export class LightsensorComponent implements OnInit { + @Input() public service: ServiceTypeX; + + constructor() { } + + ngOnInit() { + } + +} diff --git a/ui/src/app/modules/accessories/accessories.component.html b/ui/src/app/modules/accessories/accessories.component.html index a51158b87..9d4105012 100644 --- a/ui/src/app/modules/accessories/accessories.component.html +++ b/ui/src/app/modules/accessories/accessories.component.html @@ -45,6 +45,8 @@
Outlet Fan Lightbulb + Light Sensor + Lock Mechanism Temperature Sensor diff --git a/ui/src/app/modules/status/widgets/accessories-widget/accessories-widget.component.html b/ui/src/app/modules/status/widgets/accessories-widget/accessories-widget.component.html index 9ed3e79c0..3194c65dc 100644 --- a/ui/src/app/modules/status/widgets/accessories-widget/accessories-widget.component.html +++ b/ui/src/app/modules/status/widgets/accessories-widget/accessories-widget.component.html @@ -14,6 +14,8 @@ Outlet Fan Lightbulb + Light Sensor + Lock Mechanism Temperature Sensor From 7ad3f63009ded4d911a1eade4bb4ed4b51e54f7d Mon Sep 17 00:00:00 2001 From: NicoFR75 Date: Fri, 17 Apr 2020 17:36:54 +0200 Subject: [PATCH 2/3] Add accessoiries - LightSensor 2 --- .../lightsensor/lightsensor.component.html | 2 +- ui/src/assets/hap-icons/light.svg | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 ui/src/assets/hap-icons/light.svg diff --git a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html index 4faadb348..5aa4d368f 100644 --- a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html +++ b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html @@ -1,6 +1,6 @@
-
+
{{ service.customName || service.serviceName }}
{{ service.values.CurrentAmbientLightLevel }}%
diff --git a/ui/src/assets/hap-icons/light.svg b/ui/src/assets/hap-icons/light.svg new file mode 100644 index 000000000..c6c09c4a5 --- /dev/null +++ b/ui/src/assets/hap-icons/light.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + From c6bca1e233b0dc1949e90ff9d8bb988b62e3aec2 Mon Sep 17 00:00:00 2001 From: NicoFR75 Date: Fri, 17 Apr 2020 17:47:41 +0200 Subject: [PATCH 3/3] Add accessories - LightSensor (edit 3) --- .../accessories/types/lightsensor/lightsensor.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html index 5aa4d368f..4671d8a81 100644 --- a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html +++ b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.html @@ -2,6 +2,6 @@
{{ service.customName || service.serviceName }}
-
{{ service.values.CurrentAmbientLightLevel }}%
+
{{ service.values.CurrentAmbientLightLevel }} lux
\ No newline at end of file