diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 2bbdeee1e..7faac02e2 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1023,13 +1023,12 @@ void Thermostat::process_RC300Set(std::shared_ptr telegram) { // has_update(telegram, hc->selTemp, 10, 1); // single byte conversion, value is * 2 - manual telegram->read_value(hc->mode_new, 21); // 0-off, 1-manual, 2-auto - if (hc->mode_new <= 2) { + if (Helpers::hasValue(hc->mode_new)) { has_update(hc->mode, hc->mode_new); } else { uint8_t mode = hc->mode == 2 ? 0xFF : 0; // auto : manual - if (telegram->read_value(mode, 0)) { - has_update(hc->mode, mode == 0xFF ? 2 : 1); - } + telegram->read_value(mode, 0); + has_update(hc->mode, mode == 0xFF ? 2 : 1); } has_update(telegram, hc->daytemp, 2); // is * 2 has_update(telegram, hc->nighttemp, 4); // is * 2 @@ -2598,7 +2597,7 @@ bool Thermostat::set_mode_n(const uint8_t mode, const uint8_t hc_num) { if (model_ == EMSdevice::EMS_DEVICE_FLAG_RC10) { hc->mode = set_mode_value >> 1; } else if (model_ == EMSdevice::EMS_DEVICE_FLAG_RC300 || model_ == EMSdevice::EMS_DEVICE_FLAG_RC100) { - hc->mode = set_mode_value ? 1 : 0; + hc->mode = Helpers::hasValue(hc->mode_new) ? set_mode_value : set_mode_value == 0xFF ? 2 : 1; } else if (model_ == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { hc->mode = set_mode_value - 1; } else {