From 258db5c7e8d66903497160f8fc4217b5399f2685 Mon Sep 17 00:00:00 2001 From: Friso <48419274+kwertie01@users.noreply.github.com> Date: Wed, 13 Apr 2022 11:09:31 +0200 Subject: [PATCH] disable usage of T0 for RC30 in set_switchtime --- src/devices/thermostat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 36c220100..d3b2c8bcf 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -2498,13 +2498,15 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char data[1] = time; } + uint8_t min_on = 0; uint8_t max_on = 3; if ((model() == EMS_DEVICE_FLAG_RC35) || (model() == EMS_DEVICE_FLAG_RC30_N)) { max_on = 1; } else if (model() == EMS_DEVICE_FLAG_RC30) { + min_on = 1; max_on = 4; } - if (no > 41 || time > 0x90 || (on > max_on && on != 7)) { + if (no > 41 || time > 0x90 || ((on < min_on || on > max_on) && on != 7)) { // LOG_WARNING(F("Setting switchtime: Invalid data: %s"), value); // LOG_WARNING(F("Setting switchtime: Invalid data: %02d.%1d.0x%02X.%1d"), no, day, time, on); return false;