From 8d7595c261df72dca8008696171fe3713f0f64ef Mon Sep 17 00:00:00 2001 From: "Nathan J. Williams" Date: Fri, 14 Jul 2023 16:51:28 -0400 Subject: [PATCH 1/2] Don't printf() a std::optional, that doesn't work right. --- components/mitsubishi_heatpump/espmhp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mitsubishi_heatpump/espmhp.cpp b/components/mitsubishi_heatpump/espmhp.cpp index 02223a1..e1c5bf8 100644 --- a/components/mitsubishi_heatpump/espmhp.cpp +++ b/components/mitsubishi_heatpump/espmhp.cpp @@ -328,7 +328,7 @@ void MitsubishiHeatPump::hpSettingsChanged() { } else { //case "AUTO" or default: this->fan_mode = climate::CLIMATE_FAN_AUTO; } - ESP_LOGI(TAG, "Fan mode is: %i", this->fan_mode); + ESP_LOGI(TAG, "Fan mode is: %i", this->fan_mode.value_or(-1)); /* ******** HANDLE MITSUBISHI VANE CHANGES ******** * const char* VANE_MAP[7] = {"AUTO", "1", "2", "3", "4", "5", "SWING"}; From b92cf5f1ff5a0499cc6a13b4c50960a950ff6288 Mon Sep 17 00:00:00 2001 From: "Nathan J. Williams" Date: Thu, 20 Jul 2023 13:04:10 -0400 Subject: [PATCH 2/2] Fan mode and swing mode are ints, don't try to debug-print them as strings. --- components/mitsubishi_heatpump/espmhp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mitsubishi_heatpump/espmhp.cpp b/components/mitsubishi_heatpump/espmhp.cpp index e1c5bf8..f7c871d 100644 --- a/components/mitsubishi_heatpump/espmhp.cpp +++ b/components/mitsubishi_heatpump/espmhp.cpp @@ -182,7 +182,7 @@ void MitsubishiHeatPump::control(const climate::ClimateCall &call) { //const char* FAN_MAP[6] = {"AUTO", "QUIET", "1", "2", "3", "4"}; if (call.get_fan_mode().has_value()) { - ESP_LOGV("control", "Requested fan mode is %s", *call.get_fan_mode()); + ESP_LOGV("control", "Requested fan mode is %d", *call.get_fan_mode()); this->fan_mode = *call.get_fan_mode(); switch(*call.get_fan_mode()) { case climate::CLIMATE_FAN_OFF: @@ -220,7 +220,7 @@ void MitsubishiHeatPump::control(const climate::ClimateCall &call) { //const char* VANE_MAP[7] = {"AUTO", "1", "2", "3", "4", "5", "SWING"}; if (call.get_swing_mode().has_value()) { - ESP_LOGV(TAG, "control - requested swing mode is %s", + ESP_LOGD(TAG, "control - requested swing mode is %d", *call.get_swing_mode()); this->swing_mode = *call.get_swing_mode();