From 5e02b1a236261f559c049992652b357316a077e9 Mon Sep 17 00:00:00 2001 From: proddy Date: Tue, 6 Oct 2020 21:12:43 +0200 Subject: [PATCH] fix HA thermostat modes - #536 --- src/devices/thermostat.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index e0e8b693a..2d982122c 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -748,15 +748,20 @@ void Thermostat::register_mqtt_ha_config(uint8_t hc_num) { doc["temp_step"] = F("0.5"); JsonArray modes = doc.createNestedArray(F("modes")); - uint8_t flags = this->model(); - if (flags == EMSdevice::EMS_DEVICE_FLAG_RC20_2) { + modes.add(F("auto")); + modes.add(F("heat")); + modes.add(F("off")); + +/* + uint8_t model = this->model(); + if (model == EMSdevice::EMS_DEVICE_FLAG_RC20_2) { modes.add(F("night")); modes.add(F("day")); - } else if ((flags == EMSdevice::EMS_DEVICE_FLAG_RC300) || (flags == EMSdevice::EMS_DEVICE_FLAG_RC100)) { + } else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC300) || (model == EMSdevice::EMS_DEVICE_FLAG_RC100)) { modes.add(F("eco")); modes.add(F("comfort")); modes.add(F("auto")); - } else if (flags == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { + } else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { modes.add(F("nofrost")); modes.add(F("eco")); modes.add(F("heat")); @@ -766,6 +771,7 @@ void Thermostat::register_mqtt_ha_config(uint8_t hc_num) { modes.add(F("day")); modes.add(F("auto")); } + */ JsonObject dev = doc.createNestedObject(F("dev")); dev["name"] = F("EMS-ESP Thermostat");