ngFor approach works, non-local mqtt broker doesn't work so far
This commit is contained in:
@ -1,10 +1,72 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MqttclientService } from './mqttclient.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent {
|
||||
export class AppComponent implements OnInit {
|
||||
title = 'app';
|
||||
private topic : string = 'smartclient/configuration'
|
||||
configuration : any = {
|
||||
'switches': [
|
||||
{
|
||||
'room': 'Wohnzimmer',
|
||||
'switches': [
|
||||
{
|
||||
'label': 'kleine Lampe',
|
||||
'topic': 'dispatcher_ng/items/Gnd/LivingRoom/SmallLight'
|
||||
},
|
||||
{
|
||||
'label': 'große Lampe',
|
||||
'topic': 'dispatcher_ng/items/Gnd/LivingRoom/LargeLight'
|
||||
},
|
||||
{
|
||||
'label': 'Sterne',
|
||||
'topic': 'dispatcher_ng/items/Gnd/LivingRoom/Stars'
|
||||
},
|
||||
{
|
||||
'label': 'Stehlampe',
|
||||
'topic': 'dispatcher_ng/items/Gnd/LivingRoom/StandLight'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
'room': 'Esszimmer',
|
||||
'switches': [
|
||||
{
|
||||
'label': 'kleine Lampe',
|
||||
'topic': 'dispatcher_ng/items/Gnd/DiningRoom/SmallLight'
|
||||
},
|
||||
{
|
||||
'label': 'Stehlampe',
|
||||
'topic': 'dispatcher_ng/items/Gnd/DiningRoom/StandLight'
|
||||
},
|
||||
{
|
||||
'label': 'Schranklicht',
|
||||
'topic': 'dispatcher_ng/items/Gnd/DiningRoom/CupboardLight'
|
||||
},
|
||||
{
|
||||
'label': 'Naehkaestchenlicht',
|
||||
'topic': 'dispatcher_ng/items/Gnd/DiningRoom/NaehkaestchenLight'
|
||||
},
|
||||
{
|
||||
'label': 'Regallicht',
|
||||
'topic': 'dispatcher_ng/items/Gnd/DiningRoom/ShelfLight'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
constructor(private mqttclientService : MqttclientService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.mqttclientService.register(this.topic, (message: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user