Fix bug where hvac_action is set to idle when anything other than the mode is changed

This commit is contained in:
E.Talma
2024-08-06 16:54:46 +02:00
parent 1feeaeb257
commit ec2e91841a

View File

@ -444,33 +444,40 @@ void MitsubishiHeatPump::hpSettingsChanged() {
* const char* MODE_MAP[5] = {"HEAT", "DRY", "COOL", "FAN", "AUTO"};
*/
if (strcmp(currentSettings.power, "ON") == 0) {
if (strcmp(currentSettings.mode, "HEAT") == 0) {
this->mode = climate::CLIMATE_MODE_HEAT;
if (heat_setpoint != currentSettings.temperature) {
heat_setpoint = currentSettings.temperature;
save(currentSettings.temperature, heat_storage);
}
this->action = climate::CLIMATE_ACTION_IDLE;
if(this->mode != climate::CLIMATE_MODE_HEAT){
this->action = climate::CLIMATE_ACTION_IDLE;
this->mode = climate::CLIMATE_MODE_HEAT;
}
} else if (strcmp(currentSettings.mode, "DRY") == 0) {
this->mode = climate::CLIMATE_MODE_DRY;
this->action = climate::CLIMATE_ACTION_DRYING;
} else if (strcmp(currentSettings.mode, "COOL") == 0) {
this->mode = climate::CLIMATE_MODE_COOL;
if (cool_setpoint != currentSettings.temperature) {
cool_setpoint = currentSettings.temperature;
save(currentSettings.temperature, cool_storage);
}
this->action = climate::CLIMATE_ACTION_IDLE;
if(this->mode != climate::CLIMATE_MODE_COOL){
this->action = climate::CLIMATE_ACTION_IDLE;
this->mode = climate::CLIMATE_MODE_COOL;
}
} else if (strcmp(currentSettings.mode, "FAN") == 0) {
this->mode = climate::CLIMATE_MODE_FAN_ONLY;
this->action = climate::CLIMATE_ACTION_FAN;
} else if (strcmp(currentSettings.mode, "AUTO") == 0) {
this->mode = climate::CLIMATE_MODE_HEAT_COOL;
if (auto_setpoint != currentSettings.temperature) {
auto_setpoint = currentSettings.temperature;
save(currentSettings.temperature, auto_storage);
}
this->action = climate::CLIMATE_ACTION_IDLE;
if(this->mode != climate::CLIMATE_MODE_HEAT_COOL){
this->action = climate::CLIMATE_ACTION_IDLE;
this->mode = climate::CLIMATE_MODE_HEAT_COOL;
}
} else {
ESP_LOGW(
TAG,