set mode for ha climate, fix #772

This commit is contained in:
MichaelDvP
2022-11-27 19:02:54 +01:00
parent 559e607601
commit d583409af4
2 changed files with 6 additions and 1 deletions

View File

@@ -2251,7 +2251,11 @@ bool Thermostat::set_mode(const char * value, const int8_t id) {
} else { } else {
// check for the mode being a full string name // check for the mode being a full string name
if (!Helpers::value2enum(value, enum_index, mode_list)) { if (!Helpers::value2enum(value, enum_index, mode_list)) {
return false; // not found mode_list = FL_(enum_mode_ha);
if (Mqtt::ha_enabled() && !Helpers::value2enum(value, enum_index, mode_list)) {
LOG_WARNING("wrong mode: %s", value);
return false; // not found
}
} }
} }

View File

@@ -278,6 +278,7 @@ MAKE_PSTR_ENUM(enum_mode3, FL_(night), FL_(day), FL_(auto)) // RC35
MAKE_PSTR_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS MAKE_PSTR_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS
MAKE_PSTR_ENUM(enum_mode5, FL_(auto), FL_(off)) // CRF MAKE_PSTR_ENUM(enum_mode5, FL_(auto), FL_(off)) // CRF
MAKE_PSTR_ENUM(enum_mode6, FL_(nofrost), FL_(night), FL_(day)) // RC10 MAKE_PSTR_ENUM(enum_mode6, FL_(nofrost), FL_(night), FL_(day)) // RC10
MAKE_PSTR_ENUM(enum_mode_ha, FL_(off), FL_(heat), FL_(auto)) // HA climate
MAKE_PSTR_ENUM(enum_modetype, FL_(eco), FL_(comfort)) MAKE_PSTR_ENUM(enum_modetype, FL_(eco), FL_(comfort))
MAKE_PSTR_ENUM(enum_modetype3, FL_(night), FL_(day)) MAKE_PSTR_ENUM(enum_modetype3, FL_(night), FL_(day))