From fb9c19e818d602fc507375f3b6884680b0afdd58 Mon Sep 17 00:00:00 2001 From: I-am-nightingale Date: Fri, 12 Apr 2024 22:40:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D1=87=D0=BD=D0=BE=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BB=D0=BE=D1=85=D0=BE?= =?UTF-8?q?=20=D0=BE=D1=82=D1=80=D0=B0=D0=B6=D0=B0=D0=B5=D1=82=D1=81=D1=8F?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BA=D0=B0=D1=87=D0=B5=D1=81=D1=82=D0=B2?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0.=20=D0=90=20=D0=B5=D1=89?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=20=D0=BA=D0=B0=D1=87=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=BE=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20=D0=BD=D0=B5=D1=83?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tclac/tclac.cpp | 4 ++-- components/tclac/tclac.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/tclac/tclac.cpp b/components/tclac/tclac.cpp index 52b24c3..f0b789d 100644 --- a/components/tclac/tclac.cpp +++ b/components/tclac/tclac.cpp @@ -182,7 +182,7 @@ void tclacClimate::readData() { preset = ClimatePreset::CLIMATE_PRESET_ECO; } else if (dataRX[9] & (1 << 2)){ preset = ClimatePreset::CLIMATE_PRESET_COMFORT; - } else if (dataRX[7] & (1 << 7)) && (dataRX[7] & (1 << 7)) && (dataRX[7] & (1 << 7)){ + } else if ((dataRX[7] & (1 << 7)) && (dataRX[7] & (1 << 7)) && (dataRX[7] & (1 << 7))){ preset = ClimatePreset::CLIMATE_PRESET_SLEEP; } @@ -212,7 +212,7 @@ void tclacClimate::control(const ClimateCall &call) { if (call.get_preset().has_value()){ switch_preset = call.get_preset().value(); } else { - switch_preset = preset; + switch_preset = preset.value(); } // Запрашиваем данные из переключателя режимов вентилятора diff --git a/components/tclac/tclac.h b/components/tclac/tclac.h index 76f2136..3101613 100644 --- a/components/tclac/tclac.h +++ b/components/tclac/tclac.h @@ -148,6 +148,7 @@ class tclacClimate : public climate::Climate, public esphome::uart::UARTDevice, void set_horizontal_airflow(AirflowHorizontalDirection direction); void set_vertical_swing_direction(VerticalSwingDirection direction); void set_horizontal_swing_direction(HorizontalSwingDirection direction); + void set_supported_presets(const std::set &presets); void set_supported_modes(const std::set &modes); void set_supported_fan_modes(const std::set &modes); void set_supported_swing_modes(const std::set &modes);