Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LightSensor Accessory #623

Merged
merged 3 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ui/src/app/core/accessories/accessories.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -64,6 +65,7 @@ import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsy
UnknownComponent,
LightbulbComponent,
LightbulbManageComponent,
LightsensorComponent,
LockmechanismComponent,
TemperaturesensorComponent,
GaragedooropenerComponent,
Expand Down Expand Up @@ -106,6 +108,7 @@ import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsy
UnknownComponent,
LightbulbComponent,
LightbulbManageComponent,
LightsensorComponent,
LockmechanismComponent,
TemperaturesensorComponent,
GaragedooropenerComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="accessory-box">
<div class="d-flex flex-column h-100 mt-auto">
<div [inlineSVG]="'/assets/hap-icons/light.svg'" aria-label="Light Sensor" class="accessory-svg"></div>
<div class="accessory-label">{{ service.customName || service.serviceName }}</div>
<div class="accessory-label grey-text">{{ service.values.CurrentAmbientLightLevel }} lux</div>
</div>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -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() {
}

}
2 changes: 2 additions & 0 deletions ui/src/app/modules/accessories/accessories.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ <h5 class="primary-text drag-handle room-title" [ngClass]="{'cursor-move': !isMo
<app-outlet *ngSwitchCase="'Outlet'" [service]="service">Outlet</app-outlet>
<app-fan *ngSwitchCase="'Fan'" [service]="service" class="w-100">Fan</app-fan>
<app-lightbulb *ngSwitchCase="'Lightbulb'" [service]="service">Lightbulb</app-lightbulb>
<app-lightsensor *ngSwitchCase="'LightSensor'" [service]="service">Light Sensor
</app-lightsensor>
<app-lockmechanism *ngSwitchCase="'LockMechanism'" [service]="service">Lock Mechanism</app-lockmechanism>
<app-temperaturesensor *ngSwitchCase="'TemperatureSensor'" [service]="service">Temperature Sensor
</app-temperaturesensor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<app-outlet *ngSwitchCase="'Outlet'" [service]="service">Outlet</app-outlet>
<app-fan *ngSwitchCase="'Fan'" [service]="service" class="w-100">Fan</app-fan>
<app-lightbulb *ngSwitchCase="'Lightbulb'" [service]="service">Lightbulb</app-lightbulb>
<app-lightsensor *ngSwitchCase="'LightSensor'" [service]="service">Light Sensor
</app-lightsensor>
<app-lockmechanism *ngSwitchCase="'LockMechanism'" [service]="service">Lock Mechanism</app-lockmechanism>
<app-temperaturesensor *ngSwitchCase="'TemperatureSensor'" [service]="service">Temperature Sensor
</app-temperaturesensor>
Expand Down
31 changes: 31 additions & 0 deletions ui/src/assets/hap-icons/light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.