mqtt publish for temperature change
This commit is contained in:
parent
cfc7608571
commit
48e54283f9
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user