some changes
This commit is contained in:
25
dist/MaxThermostat.js
vendored
25
dist/MaxThermostat.js
vendored
@ -27,8 +27,14 @@ class MaxThermostat extends AHomematicItem_1.AHomematicItem {
|
||||
});
|
||||
}
|
||||
processMessage(topic, payload) {
|
||||
if ((topic == this.temperatureTopic) || (topic == this.deviceFeedbackTopic)) {
|
||||
let setTemperature = false;
|
||||
if (topic == this.temperatureTopic) {
|
||||
this.temperature = parseFloat(payload);
|
||||
setTemperature = true;
|
||||
}
|
||||
else if (topic == this.deviceFeedbackTopic) {
|
||||
// this.temperature = parseFloat(payload)
|
||||
setTemperature = false;
|
||||
}
|
||||
else if (topic in this.windowContactMap) {
|
||||
this.windowContactMap[topic].state = payload;
|
||||
@ -38,14 +44,17 @@ class MaxThermostat extends AHomematicItem_1.AHomematicItem {
|
||||
this.windowOpen = true;
|
||||
}
|
||||
});
|
||||
setTemperature = true;
|
||||
}
|
||||
if (!this.windowOpen) {
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.temperature}`);
|
||||
}
|
||||
else {
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${WINDOW_OPEN_TEMPERATURE}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${WINDOW_OPEN_TEMPERATURE}`);
|
||||
if (setTemperature) {
|
||||
if (!this.windowOpen) {
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.temperature}`);
|
||||
}
|
||||
else {
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${WINDOW_OPEN_TEMPERATURE}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${WINDOW_OPEN_TEMPERATURE}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user