From 07cb903334bfd467312af552fc0caff39e644ab9 Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Tue, 13 Aug 2024 07:22:14 +0200 Subject: [PATCH] rollback --- esphome/components/haier/haier_base.cpp | 6 +++--- esphome/components/haier/hon_climate.cpp | 6 +++--- esphome/components/haier/hon_climate.h | 4 ++-- esphome/components/haier/smartair2_climate.cpp | 6 +++--- esphome/components/haier/smartair2_climate.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/esphome/components/haier/haier_base.cpp b/esphome/components/haier/haier_base.cpp index 37d352ca27..0bd3863160 100644 --- a/esphome/components/haier/haier_base.cpp +++ b/esphome/components/haier/haier_base.cpp @@ -310,13 +310,13 @@ bool HaierClimateBase::prepare_pending_action() { case ActionRequest::SEND_CUSTOM_COMMAND: return true; case ActionRequest::TURN_POWER_ON: - this->action_request_.value().message = this->get_power_message_(true); + this->action_request_.value().message = this->get_power_message(true); return true; case ActionRequest::TURN_POWER_OFF: - this->action_request_.value().message = this->get_power_message_(false); + this->action_request_.value().message = this->get_power_message(false); return true; case ActionRequest::TOGGLE_POWER: - this->action_request_.value().message = this->get_power_message_(this->mode == ClimateMode::CLIMATE_MODE_OFF); + this->action_request_.value().message = this->get_power_message(this->mode == ClimateMode::CLIMATE_MODE_OFF); return true; default: ESP_LOGW(TAG, "Unsupported action: %d", (uint8_t) this->action_request_.value().action); diff --git a/esphome/components/haier/hon_climate.cpp b/esphome/components/haier/hon_climate.cpp index 3cb28ab6b8..a1c5098cec 100644 --- a/esphome/components/haier/hon_climate.cpp +++ b/esphome/components/haier/hon_climate.cpp @@ -394,7 +394,7 @@ void HonClimate::process_phase(std::chrono::steady_clock::time_point now) { if (this->control_messages_queue_.empty()) { switch (this->control_method_) { case HonControlMethod::SET_GROUP_PARAMETERS: { - haier_protocol::HaierMessage control_message = this->get_control_message_(); + haier_protocol::HaierMessage control_message = this->get_control_message(); this->control_messages_queue_.push(control_message); } break; case HonControlMethod::SET_SINGLE_PARAMETER: @@ -459,7 +459,7 @@ void HonClimate::process_phase(std::chrono::steady_clock::time_point now) { } } -haier_protocol::HaierMessage HonClimate::get_power_message_(bool state) { +haier_protocol::HaierMessage HonClimate::get_power_message(bool state) { if (state) { static haier_protocol::HaierMessage power_on_message( haier_protocol::FrameType::CONTROL, ((uint16_t) hon_protocol::SubcommandsControl::SET_SINGLE_PARAMETER) + 1, @@ -486,7 +486,7 @@ void HonClimate::initialization() { this->current_horizontal_swing_ = this->settings_.last_horizontal_swing; } -haier_protocol::HaierMessage HonClimate::get_control_message_() { +haier_protocol::HaierMessage HonClimate::get_control_message() { uint8_t control_out_buffer[haier_protocol::MAX_FRAME_SIZE]; memcpy(control_out_buffer, this->last_status_message_.get(), this->real_control_packet_size_); hon_protocol::HaierPacketControl *out_data = (hon_protocol::HaierPacketControl *) control_out_buffer; diff --git a/esphome/components/haier/hon_climate.h b/esphome/components/haier/hon_climate.h index b49e7108e5..64c54186ed 100644 --- a/esphome/components/haier/hon_climate.h +++ b/esphome/components/haier/hon_climate.h @@ -114,8 +114,8 @@ class HonClimate : public HaierClimateBase { protected: void set_handlers() override; void process_phase(std::chrono::steady_clock::time_point now) override; - haier_protocol::HaierMessage get_control_message_() override; - haier_protocol::HaierMessage get_power_message_(bool state) override; + haier_protocol::HaierMessage get_control_message() override; + haier_protocol::HaierMessage get_power_message(bool state) override; void initialization() override; bool prepare_pending_action() override; void process_protocol_reset() override; diff --git a/esphome/components/haier/smartair2_climate.cpp b/esphome/components/haier/smartair2_climate.cpp index 57fed470f8..028e8a4087 100644 --- a/esphome/components/haier/smartair2_climate.cpp +++ b/esphome/components/haier/smartair2_climate.cpp @@ -180,7 +180,7 @@ void Smartair2Climate::process_phase(std::chrono::steady_clock::time_point now) case ProtocolPhases::SENDING_CONTROL: if (this->can_send_message() && this->is_control_message_interval_exceeded_(now)) { ESP_LOGI(TAG, "Sending control packet"); - this->send_message_(get_control_message_(), this->use_crc_, CONTROL_MESSAGE_RETRIES, + this->send_message_(get_control_message(), this->use_crc_, CONTROL_MESSAGE_RETRIES, CONTROL_MESSAGE_RETRIES_INTERVAL); } break; @@ -220,7 +220,7 @@ void Smartair2Climate::process_phase(std::chrono::steady_clock::time_point now) } } -haier_protocol::HaierMessage Smartair2Climate::get_power_message_(bool state) { +haier_protocol::HaierMessage Smartair2Climate::get_power_message(bool state) { if (state) { static haier_protocol::HaierMessage power_on_message(haier_protocol::FrameType::CONTROL, 0x4D02); return power_on_message; @@ -230,7 +230,7 @@ haier_protocol::HaierMessage Smartair2Climate::get_power_message_(bool state) { } } -haier_protocol::HaierMessage Smartair2Climate::get_control_message_() { +haier_protocol::HaierMessage Smartair2Climate::get_control_message() { uint8_t control_out_buffer[sizeof(smartair2_protocol::HaierPacketControl)]; memcpy(control_out_buffer, this->last_status_message_.get(), sizeof(smartair2_protocol::HaierPacketControl)); smartair2_protocol::HaierPacketControl *out_data = (smartair2_protocol::HaierPacketControl *) control_out_buffer; diff --git a/esphome/components/haier/smartair2_climate.h b/esphome/components/haier/smartair2_climate.h index e2c9eb1db1..6914d8a1fb 100644 --- a/esphome/components/haier/smartair2_climate.h +++ b/esphome/components/haier/smartair2_climate.h @@ -18,8 +18,8 @@ class Smartair2Climate : public HaierClimateBase { protected: void set_handlers() override; void process_phase(std::chrono::steady_clock::time_point now) override; - haier_protocol::HaierMessage get_power_message_(bool state) override; - haier_protocol::HaierMessage get_control_message_() override; + haier_protocol::HaierMessage get_power_message(bool state) override; + haier_protocol::HaierMessage get_control_message() override; // Answer handlers haier_protocol::HandlerError status_handler_(haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data,