climate min/max values

This commit is contained in:
MichaelDvP
2022-10-02 09:52:04 +02:00
parent e450a0e096
commit c414354708
7 changed files with 65 additions and 27 deletions

View File

@@ -1248,7 +1248,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type,
publish_ha(topic, doc.as<JsonObject>());
}
void Mqtt::publish_ha_climate_config(uint8_t tag, bool has_roomtemp, bool remove) {
void Mqtt::publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, const bool remove, const int16_t min, const uint16_t max) {
uint8_t hc_num = tag - DeviceValueTAG::TAG_HC1 + 1;
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
@@ -1321,8 +1321,8 @@ void Mqtt::publish_ha_climate_config(uint8_t tag, bool has_roomtemp, bool remove
doc["curr_temp_tpl"] = currtemp_s;
}
doc["min_temp"] = Helpers::render_value(min_s, (uint32_t)5, 0, EMSESP::system_.fahrenheit() ? 2 : 0);
doc["max_temp"] = Helpers::render_value(max_s, (uint32_t)30, 0, EMSESP::system_.fahrenheit() ? 2 : 0);
doc["min_temp"] = Helpers::render_value(min_s, min, 0, EMSESP::system_.fahrenheit() ? 2 : 0);
doc["max_temp"] = Helpers::render_value(max_s, max, 0, EMSESP::system_.fahrenheit() ? 2 : 0);
doc["temp_step"] = "0.5";
// the HA climate component only responds to auto, heat and off