diff --git a/esphome/components/haier/haier_base.cpp b/esphome/components/haier/haier_base.cpp index 0bd3863160..37d352ca27 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/haier_base.h b/esphome/components/haier/haier_base.h index 1a1230045f..1d0db51ddb 100644 --- a/esphome/components/haier/haier_base.h +++ b/esphome/components/haier/haier_base.h @@ -80,8 +80,8 @@ class HaierClimateBase : public esphome::Component, const char *phase_to_string_(ProtocolPhases phase); virtual void set_handlers() = 0; virtual void process_phase(std::chrono::steady_clock::time_point now) = 0; - virtual haier_protocol::HaierMessage get_control_message() = 0; // NOLINT(readability-identifier-naming) - virtual haier_protocol::HaierMessage get_power_message(bool state) = 0; // NOLINT(readability-identifier-naming) + virtual haier_protocol::HaierMessage get_control_message_() = 0; + virtual haier_protocol::HaierMessage get_power_message_(bool state) = 0; virtual void initialization(){}; virtual bool prepare_pending_action(); virtual void process_protocol_reset(); diff --git a/esphome/components/haier/hon_climate.cpp b/esphome/components/haier/hon_climate.cpp index a1c5098cec..3cb28ab6b8 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 64c54186ed..b49e7108e5 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 028e8a4087..57fed470f8 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 6914d8a1fb..e2c9eb1db1 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,