minor cleanup

This commit is contained in:
proddy
2021-03-21 12:48:03 +01:00
parent f2dbc26491
commit 25b1957dbf
10 changed files with 29 additions and 137 deletions

View File

@@ -227,8 +227,7 @@ bool Boiler::publish_ha_config() {
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
snprintf_P(topic, sizeof(topic), PSTR("homeassistant/sensor/%s/boiler/config"), Mqtt::base().c_str());
Mqtt::publish_ha(topic,
doc.as<JsonObject>()); // publish the config payload with retain flag
Mqtt::publish_ha(topic, doc.as<JsonObject>()); // publish the config payload with retain flag
return true;
}

View File

@@ -448,9 +448,9 @@ bool Thermostat::thermostat_ha_cmd(const char * message, uint8_t hc_num) {
return false;
}
// check for mode first
// check for mode first, which is a string
if (!set_mode(message, hc_num)) {
// handle as a numerical temperature value
// otherwise handle as a numerical temperature value and set the setpoint temp
float f = strtof((char *)message, 0);
set_temperature(f, HeatingCircuit::Mode::AUTO, hc_num);
}