dev 37, add SRC thermostat icons to climate

This commit is contained in:
MichaelDvP
2025-12-15 11:56:54 +01:00
parent 71b956e613
commit 2b679daabc
4 changed files with 18 additions and 4 deletions

View File

@@ -2134,9 +2134,16 @@ void EMSdevice::mqtt_ha_entity_config_create() {
// SRC thermostats mapped to connect/src1/...
if (dv.tag >= DeviceValueTAG::TAG_SRC1 && dv.tag <= DeviceValueTAG::TAG_SRC16 && !strcmp(dv.short_name, FL_(selRoomTemp)[0])) {
const char * icon = nullptr;
for (auto & d : devicevalues_) {
if (d.tag == dv.tag && !strcmp(d.short_name, FL_(icon)[0]) && *(uint8_t *)(d.value_p != 0)) {
icon = d.options[*(uint8_t *)(d.value_p)][0];
break;
}
}
// add all modes - auto, heat, off, cool
// https://github.com/emsesp/EMS-ESP32/issues/2636
Mqtt::publish_ha_climate_config(dv, true, nullptr, false);
Mqtt::publish_ha_climate_config(dv, true, nullptr, false, icon);
}
#ifndef EMSESP_STANDALONE