diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 17c1c1ab9..b488eba3b 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -964,7 +964,7 @@ void Thermostat::register_mqtt_ha_config(uint8_t hc_num) { // for each of the heating circuits std::string topic2(100, '\0'); snprintf_P(&topic2[0], topic2.capacity() + 1, PSTR("thermostat_hc%d"), hc_num); - register_mqtt_topic(topic2, [&](const char * m) { return thermostat_ha_cmd(m, hc_num); }); + register_mqtt_topic(topic2, [=](const char * m) { return thermostat_ha_cmd(m, hc_num); }); char hc_name[10]; // hc{1-4} strlcpy(hc_name, "hc", 10); @@ -1023,7 +1023,7 @@ void Thermostat::register_mqtt_ha_config(uint8_t hc_num) { } // for HA specifically when receiving over MQTT in the thermostat topic -// it could be either a 'mode' or a float value +// it could be either a 'mode' or a float value for a temperature. we try brute force both and see which one works. // return true if it parses the message correctly bool Thermostat::thermostat_ha_cmd(const char * message, uint8_t hc_num) { // check if it's json. We know the message isn't empty