Skip to content

Commit

Permalink
Fixed esp-idf build
Browse files Browse the repository at this point in the history
  • Loading branch information
paveldn committed Oct 22, 2023
1 parent 141428b commit 3c20146
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions components/haier/haier_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ void HaierClimateBase::set_health_mode(bool state) {
}
}

void HaierClimateBase::send_power_on_command() { this->action_request_ = PendingAction({ActionRequest::TURN_POWER_ON}); }
void HaierClimateBase::send_power_on_command() { this->action_request_ = PendingAction({ActionRequest::TURN_POWER_ON, esphome::optional<haier_protocol::HaierMessage>()}); }

void HaierClimateBase::send_power_off_command() { this->action_request_ = PendingAction({ActionRequest::TURN_POWER_OFF}); }
void HaierClimateBase::send_power_off_command() { this->action_request_ = PendingAction({ActionRequest::TURN_POWER_OFF, esphome::optional<haier_protocol::HaierMessage>()}); }

void HaierClimateBase::toggle_power() { this->action_request_ = PendingAction({ActionRequest::TOGGLE_POWER}); }
void HaierClimateBase::toggle_power() { this->action_request_ = PendingAction({ActionRequest::TOGGLE_POWER, esphome::optional<haier_protocol::HaierMessage>()}); }

void HaierClimateBase::set_supported_swing_modes(const std::set<climate::ClimateSwingMode> &modes) {
this->traits_.set_supported_swing_modes(modes);
Expand Down
8 changes: 5 additions & 3 deletions components/haier/hon_climate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ CleaningState HonClimate::get_cleaning_status() const { return this->cleaning_st
void HonClimate::start_self_cleaning() {
if (this->cleaning_status_ == CleaningState::NO_CLEANING) {
ESP_LOGI(TAG, "Sending self cleaning start request");
this->action_request_= PendingAction({ActionRequest::START_SELF_CLEAN});
this->action_request_= PendingAction({ActionRequest::START_SELF_CLEAN, esphome::optional<haier_protocol::HaierMessage>()});
}
}

void HonClimate::start_steri_cleaning() {
if (this->cleaning_status_ == CleaningState::NO_CLEANING) {
ESP_LOGI(TAG, "Sending steri cleaning start request");
this->action_request_ = PendingAction({ActionRequest::START_STERI_CLEAN});
this->action_request_ = PendingAction({ActionRequest::START_STERI_CLEAN, esphome::optional<haier_protocol::HaierMessage>()});
}
}

Expand Down Expand Up @@ -212,6 +212,8 @@ haier_protocol::HandlerError HonClimate::status_handler_(haier_protocol::FrameTy
this->set_phase(ProtocolPhases::SENDING_CONTROL);
}
break;
default:
break;
}
}
return result;
Expand Down Expand Up @@ -710,7 +712,7 @@ haier_protocol::HandlerError HonClimate::process_status_message_(const uint8_t *
ESP_LOGD(TAG, "Cleaning status change: %d => %d", (uint8_t) this->cleaning_status_, (uint8_t) new_cleaning);
if (new_cleaning == CleaningState::NO_CLEANING) {
// Turning AC off after cleaning
this->action_request_ = PendingAction({ActionRequest::TURN_POWER_OFF});
this->action_request_ = PendingAction({ActionRequest::TURN_POWER_OFF, esphome::optional<haier_protocol::HaierMessage>()});
}
this->cleaning_status_ = new_cleaning;
}
Expand Down
2 changes: 2 additions & 0 deletions components/haier/smartair2_climate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ haier_protocol::HandlerError Smartair2Climate::status_handler_(haier_protocol::F
if (this->current_hvac_settings_.valid)
this->current_hvac_settings_.reset();
break;
default:
break;
}
}
return result;
Expand Down

0 comments on commit 3c20146

Please sign in to comment.