revert back subscription of only active heating circuits

This commit is contained in:
MichaelDvP
2020-02-01 14:36:15 +01:00
parent 4cc237bcc3
commit 14e4c6f2a3

View File

@@ -1448,16 +1448,13 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
char topic_s[50]; char topic_s[50];
char buffer[4]; char buffer[4];
for (uint8_t hc = 1; hc <= EMS_THERMOSTAT_MAXHC; hc++) { for (uint8_t hc = 1; hc <= EMS_THERMOSTAT_MAXHC; hc++) {
// subscribe onlyto active hc strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_TEMP_HA, sizeof(topic_s));
if (EMS_Thermostat.hc[hc - 1].active) { strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s));
strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_TEMP_HA, sizeof(topic_s)); myESP.mqttSubscribe(topic_s);
strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s));
myESP.mqttSubscribe(topic_s);
strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_MODE_HA, sizeof(topic_s)); strlcpy(topic_s, TOPIC_THERMOSTAT_CMD_MODE_HA, sizeof(topic_s));
strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s)); strlcat(topic_s, itoa(hc, buffer, 10), sizeof(topic_s));
myESP.mqttSubscribe(topic_s); myESP.mqttSubscribe(topic_s);
}
} }
// generic incoming MQTT command for Thermostat // generic incoming MQTT command for Thermostat