tune with dispatcher output
This commit is contained in:
parent
fdf0c55094
commit
6e9cdd1a11
@ -6,7 +6,16 @@ ledbox {
|
|||||||
float: left;
|
float: left;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
onoff {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
p.clear {
|
p.clear {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#scenes {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
@ -1,6 +1,13 @@
|
|||||||
|
|
||||||
<mat-tab-group>
|
<mat-tab-group>
|
||||||
<mat-tab label="Licht">
|
<mat-tab label="Licht">
|
||||||
|
<div id="scenes">
|
||||||
|
<onoff *ngFor="let scene of configuration.scenes"
|
||||||
|
[label]="scene.label" [topic]="scene.actionTopic"></onoff>
|
||||||
|
<p class="clear"></p>
|
||||||
|
</div>
|
||||||
|
<mat-divider></mat-divider>
|
||||||
|
|
||||||
<mat-accordion>
|
<mat-accordion>
|
||||||
<mat-expansion-panel *ngFor="let room of configuration.switches">
|
<mat-expansion-panel *ngFor="let room of configuration.switches">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
|
@ -5,6 +5,7 @@ import { NgModule } from '@angular/core';
|
|||||||
import { MatTabsModule } from '@angular/material/tabs';
|
import { MatTabsModule } from '@angular/material/tabs';
|
||||||
import { MatExpansionModule } from '@angular/material/expansion';
|
import { MatExpansionModule } from '@angular/material/expansion';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatDividerModule } from '@angular/material/divider';
|
||||||
|
|
||||||
import { MqttclientService } from './mqttclient.service'
|
import { MqttclientService } from './mqttclient.service'
|
||||||
|
|
||||||
@ -32,7 +33,8 @@ import { LedBoxComponent } from './led-box/led-box.component';
|
|||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatExpansionModule,
|
MatExpansionModule,
|
||||||
MatButtonModule
|
MatButtonModule,
|
||||||
|
MatDividerModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
MqttclientService
|
MqttclientService
|
||||||
|
@ -5,7 +5,7 @@ import { MqttclientService } from '../mqttclient.service'
|
|||||||
selector: 'ledbox',
|
selector: 'ledbox',
|
||||||
template: `
|
template: `
|
||||||
<div [ngStyle]="{ 'text-align': 'center', 'background-color':'lightgrey', 'border-radius':'10px',
|
<div [ngStyle]="{ 'text-align': 'center', 'background-color':'lightgrey', 'border-radius':'10px',
|
||||||
'width': '100px', 'padding':'5px', 'margin': '5px',
|
'width': '100px', 'height':'80px', 'padding':'5px', 'margin': '5px',
|
||||||
'font-family': 'sans-serif' }">
|
'font-family': 'sans-serif' }">
|
||||||
{{label}}<br/>
|
{{label}}<br/>
|
||||||
<led [topic]="topic" greenToken="CLOSED" redToken="OPEN"></led>
|
<led [topic]="topic" greenToken="CLOSED" redToken="OPEN"></led>
|
||||||
|
@ -4,14 +4,18 @@ import { MqttclientService } from '../mqttclient.service'
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'onoff',
|
selector: 'onoff',
|
||||||
template: `
|
template: `
|
||||||
<div class="button">
|
<div [ngStyle]="{ 'text-align': 'center', 'background-color':'lightgrey', 'border-radius':'10px',
|
||||||
<button (click)="clickOn()" [ngStyle]="{'font-size':'150%'}">on</button>
|
'width': '150px', 'padding':'5px', 'margin': '5px',
|
||||||
<button (click)="clickOff()" [ngStyle]="{'font-size':'150%'}">off</button>
|
'font-family': 'sans-serif' }">
|
||||||
|
{{label}}<br/>
|
||||||
|
<button mat-mini-fab color="primary" (click)="clickOff()" [ngStyle]="{'font-size':'100%'}">off</button>
|
||||||
|
<button mat-mini-fab color="primary" (click)="clickOn()" [ngStyle]="{'font-size':'100%'}">on</button>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class OnOffButtonComponent implements OnInit {
|
export class OnOffButtonComponent implements OnInit {
|
||||||
@Input() topic : string = 'invalid'
|
@Input() topic : string = 'invalid'
|
||||||
|
@Input() label : string = 'invalid'
|
||||||
|
|
||||||
constructor(private mqttclientService : MqttclientService) { }
|
constructor(private mqttclientService : MqttclientService) { }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user