mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 06:04:01 +00:00
minimize changes
This commit is contained in:
@@ -1034,8 +1034,8 @@ haier_protocol::HandlerError HonClimate::process_status_message_(const uint8_t *
|
|||||||
// Swing mode
|
// Swing mode
|
||||||
ClimateSwingMode old_swing_mode = this->swing_mode;
|
ClimateSwingMode old_swing_mode = this->swing_mode;
|
||||||
const auto &swing_modes = traits_.get_supported_swing_modes();
|
const auto &swing_modes = traits_.get_supported_swing_modes();
|
||||||
bool vertical_swing_supported = swing_modes.contains(CLIMATE_SWING_VERTICAL);
|
bool vertical_swing_supported = swing_modes.count(CLIMATE_SWING_VERTICAL) > 0;
|
||||||
bool horizontal_swing_supported = swing_modes.contains(CLIMATE_SWING_HORIZONTAL);
|
bool horizontal_swing_supported = swing_modes.count(CLIMATE_SWING_HORIZONTAL) > 0;
|
||||||
if (horizontal_swing_supported &&
|
if (horizontal_swing_supported &&
|
||||||
(packet.control.horizontal_swing_mode == (uint8_t) hon_protocol::HorizontalSwingMode::AUTO)) {
|
(packet.control.horizontal_swing_mode == (uint8_t) hon_protocol::HorizontalSwingMode::AUTO)) {
|
||||||
if (vertical_swing_supported &&
|
if (vertical_swing_supported &&
|
||||||
@@ -1218,13 +1218,13 @@ void HonClimate::fill_control_messages_queue_() {
|
|||||||
(uint8_t) hon_protocol::DataParameters::QUIET_MODE,
|
(uint8_t) hon_protocol::DataParameters::QUIET_MODE,
|
||||||
quiet_mode_buf, 2);
|
quiet_mode_buf, 2);
|
||||||
}
|
}
|
||||||
if ((fast_mode_buf[1] != 0xFF) && presets.contains(climate::ClimatePreset::CLIMATE_PRESET_BOOST)) {
|
if ((fast_mode_buf[1] != 0xFF) && (presets.count(climate::ClimatePreset::CLIMATE_PRESET_BOOST) > 0)) {
|
||||||
this->control_messages_queue_.emplace(haier_protocol::FrameType::CONTROL,
|
this->control_messages_queue_.emplace(haier_protocol::FrameType::CONTROL,
|
||||||
(uint16_t) hon_protocol::SubcommandsControl::SET_SINGLE_PARAMETER +
|
(uint16_t) hon_protocol::SubcommandsControl::SET_SINGLE_PARAMETER +
|
||||||
(uint8_t) hon_protocol::DataParameters::FAST_MODE,
|
(uint8_t) hon_protocol::DataParameters::FAST_MODE,
|
||||||
fast_mode_buf, 2);
|
fast_mode_buf, 2);
|
||||||
}
|
}
|
||||||
if ((away_mode_buf[1] != 0xFF) && presets.contains(climate::ClimatePreset::CLIMATE_PRESET_AWAY)) {
|
if ((away_mode_buf[1] != 0xFF) && (presets.count(climate::ClimatePreset::CLIMATE_PRESET_AWAY) > 0)) {
|
||||||
this->control_messages_queue_.emplace(haier_protocol::FrameType::CONTROL,
|
this->control_messages_queue_.emplace(haier_protocol::FrameType::CONTROL,
|
||||||
(uint16_t) hon_protocol::SubcommandsControl::SET_SINGLE_PARAMETER +
|
(uint16_t) hon_protocol::SubcommandsControl::SET_SINGLE_PARAMETER +
|
||||||
(uint8_t) hon_protocol::DataParameters::TEN_DEGREE,
|
(uint8_t) hon_protocol::DataParameters::TEN_DEGREE,
|
||||||
|
|||||||
Reference in New Issue
Block a user