mqtt publish for temperature change

This commit is contained in:
Wolfgang Hottgenroth 2018-09-21 14:00:37 +02:00
parent cfc7608571
commit 48e54283f9
Signed by: wn
GPG Key ID: B586EAFCDF2F65F4
2 changed files with 4 additions and 1 deletions

View File

@ -80,10 +80,12 @@ export class HeatingControllerComponent implements OnInit {
setCurrentTemperature() {
console.log(`click on currentTemperature ${this.currentTemperature}`)
this.mqttclientService.publish(this.temperatureTopic, this.currentTemperature.toString())
}
setPresetTemperature() {
console.log(`click on presetTemperature ${this.presetTemperature}`)
this.mqttclientService.publish(this.presetTopic, this.presetTemperature.toString())
}
}

View File

@ -9,7 +9,8 @@ export class MqttclientService {
private callbacks : Map<string, callbackFunc> = new Map()
constructor() {
this.mqttClient = Mqtt.connect('ws://172.16.2.16:9001')
// this.mqttClient = Mqtt.connect('ws://172.16.2.16:9001')
this.mqttClient = Mqtt.connect('ws://127.0.0.1:9001')
this.mqttClient.on('connect', () => {
console.log('MQTT connected')
this.callbacks.forEach((value: callbackFunc, key: string) => {