Ночное программирование плохо отражается на качестве кода. А еще на качестве кода отражается неумение программировать.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
// Запрашиваем данные из переключателя режимов вентилятора
|
||||
|
||||
@@ -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<climate::ClimatePreset> &presets);
|
||||
void set_supported_modes(const std::set<esphome::climate::ClimateMode> &modes);
|
||||
void set_supported_fan_modes(const std::set<esphome::climate::ClimateFanMode> &modes);
|
||||
void set_supported_swing_modes(const std::set<esphome::climate::ClimateSwingMode> &modes);
|
||||
|
||||
Reference in New Issue
Block a user