climate: Add features to generic Toshiba model (#3912)

Add fan speed modes, dry and fan-only operation modes.
This reduce differences between generic and PT14111 models.
This commit is contained in:
Björn Stenberg
2022-12-08 21:13:10 +01:00
committed by GitHub
parent 0c24d951ff
commit cc45945fcf
2 changed files with 32 additions and 17 deletions
+28 -4
View File
@@ -124,9 +124,6 @@ void ToshibaClimate::setup() {
// Set supported modes & temperatures based on model
this->minimum_temperature_ = this->temperature_min_();
this->maximum_temperature_ = this->temperature_max_();
this->supports_dry_ = this->toshiba_supports_dry_();
this->supports_fan_only_ = this->toshiba_supports_fan_only_();
this->fan_modes_ = this->toshiba_fan_modes_();
this->swing_modes_ = this->toshiba_swing_modes_();
// Never send nan to HA
if (std::isnan(this->target_temperature))
@@ -178,12 +175,39 @@ void ToshibaClimate::transmit_generic_() {
mode = TOSHIBA_MODE_COOL;
break;
case climate::CLIMATE_MODE_DRY:
mode = TOSHIBA_MODE_DRY;
break;
case climate::CLIMATE_MODE_FAN_ONLY:
mode = TOSHIBA_MODE_FAN_ONLY;
break;
case climate::CLIMATE_MODE_HEAT_COOL:
default:
mode = TOSHIBA_MODE_AUTO;
}
message[6] |= mode | TOSHIBA_FAN_SPEED_AUTO;
uint8_t fan;
switch (this->fan_mode.value()) {
case climate::CLIMATE_FAN_LOW:
fan = TOSHIBA_FAN_SPEED_1;
break;
case climate::CLIMATE_FAN_MEDIUM:
fan = TOSHIBA_FAN_SPEED_3;
break;
case climate::CLIMATE_FAN_HIGH:
fan = TOSHIBA_FAN_SPEED_5;
break;
case climate::CLIMATE_FAN_AUTO:
default:
fan = TOSHIBA_FAN_SPEED_AUTO;
break;
}
message[6] = fan | mode;
// Zero
message[7] = 0x00;