From 3115fae80707bc155faaf447136d3c529160ca12 Mon Sep 17 00:00:00 2001 From: tp1de Date: Wed, 25 May 2022 13:38:50 +0200 Subject: [PATCH] Added enum_controlmode1 - Adjusted enum list for RC310 --- CHANGELOG_LATEST.md | 1 + src/devices/thermostat.cpp | 11 ++++++++--- src/locale_EN.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 9c8ebf8c1..b7f7965d7 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,6 +4,7 @@ ### Added +- Added enum_controlmode1 for RC310 (enum list) - Added nofrostmode1, reducemode1,reducetemp & noreducetemp for RC310 - Added emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310 - WebUI optimizations, updated look&feel and better performance [#124](https://github.com/emsesp/EMS-ESP32/issues/124) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 7a51cf30f..e2f8e556f 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1008,7 +1008,7 @@ void Thermostat::process_RC300Curve(std::shared_ptr telegram) { return; } - has_update(telegram, hc->controlmode, 0); // 1-outdoor, 2-simple, 3-MPC, 4-room, 5-power, 6-const + has_enumupdate(telegram, hc->controlmode, 0, 1); // 1-weather_compensated, 2-outside_footpoint,3-n/a, 4-room -- RC310 has_update(telegram, hc->heatingtype, 1); // 1=radiator, 2=convector, 3=floor has_enumupdate(telegram, hc->nofrostmode1, 5, 1); // 1-room, 2-outdoor, 3- room & outdoor has_update(telegram, hc->nofrosttemp, 6); @@ -2509,11 +2509,16 @@ bool Thermostat::set_controlmode(const char * value, const int8_t id) { } uint8_t set = 0xFF; - if (model() == EMS_DEVICE_FLAG_RC300 || model() == EMS_DEVICE_FLAG_RC100) { + if (model() == EMS_DEVICE_FLAG_RC100) { if (Helpers::value2enum(value, set, FL_(enum_controlmode))) { write_command(curve_typeids[hc->hc()], 0, set, curve_typeids[hc->hc()]); return true; } + } else if (model() == EMS_DEVICE_FLAG_RC300) { + if (Helpers::value2enum(value, set, FL_(enum_controlmode1))) { + write_command(curve_typeids[hc->hc()], 0, set + 1, curve_typeids[hc->hc()]); + return true; + } } else if (model() == EMS_DEVICE_FLAG_RC30) { if (Helpers::value2enum(value, set, FL_(enum_controlmode2))) { write_command(curve_typeids[hc->hc()], 1, set, curve_typeids[hc->hc()]); @@ -3896,7 +3901,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrsummermode, DeviceValueType::ENUM, FL_(enum_summer), FL_(summermode), DeviceValueUOM::NONE); register_device_value( - tag, &hc->controlmode, DeviceValueType::ENUM, FL_(enum_controlmode), FL_(controlmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_controlmode)); + tag, &hc->controlmode, DeviceValueType::ENUM, FL_(enum_controlmode1), FL_(controlmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_controlmode)); register_device_value(tag, &hc->program, DeviceValueType::ENUM, FL_(enum_progMode), FL_(program), DeviceValueUOM::NONE, MAKE_CF_CB(set_program)); register_device_value( tag, &hc->tempautotemp, DeviceValueType::INT, FL_(div2), FL_(tempautotemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_tempautotemp), -1, 30); diff --git a/src/locale_EN.h b/src/locale_EN.h index 9d53f60ad..914f38db9 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -389,6 +389,7 @@ MAKE_PSTR_LIST(enum_nofrostmode, F_(off), F_(room), F_(outdoor)) MAKE_PSTR_LIST(enum_nofrostmode1, F_(room), F_(outdoor), F_(room_outdoor)) MAKE_PSTR_LIST(enum_controlmode, F_(off), F_(optimized), F_(simple), F_(mpc), F_(room), F_(power), F_(constant)) +MAKE_PSTR_LIST(enum_controlmode1, F("weather-compensated") ,F("outside-basepoint"), F("n/a"), F_(room)) // RC310 1-4 MAKE_PSTR_LIST(enum_controlmode2, F_(outdoor), F_(room)) // MAKE_PSTR_LIST(enum_controlmode3, F_(off), F_(room), F_(outdoor), F("room+outdoor")) MAKE_PSTR_LIST(enum_control, F_(off), F_(rc20), F_(rc3x))