mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
toshiba: add support for quiet fan mode (#4283)
This commit is contained in:
parent
48e76e1538
commit
ba6f89a757
2 changed files with 29 additions and 1 deletions
|
@ -190,6 +190,10 @@ void ToshibaClimate::transmit_generic_() {
|
|||
|
||||
uint8_t fan;
|
||||
switch (this->fan_mode.value()) {
|
||||
case climate::CLIMATE_FAN_QUIET:
|
||||
fan = TOSHIBA_FAN_SPEED_QUIET;
|
||||
break;
|
||||
|
||||
case climate::CLIMATE_FAN_LOW:
|
||||
fan = TOSHIBA_FAN_SPEED_1;
|
||||
break;
|
||||
|
@ -692,6 +696,30 @@ bool ToshibaClimate::on_receive(remote_base::RemoteReceiveData data) {
|
|||
this->mode = climate::CLIMATE_MODE_HEAT_COOL;
|
||||
}
|
||||
|
||||
// Get the fan mode
|
||||
switch (message[6] & 0xF0) {
|
||||
case TOSHIBA_FAN_SPEED_QUIET:
|
||||
this->fan_mode = climate::CLIMATE_FAN_QUIET;
|
||||
break;
|
||||
|
||||
case TOSHIBA_FAN_SPEED_1:
|
||||
this->fan_mode = climate::CLIMATE_FAN_LOW;
|
||||
break;
|
||||
|
||||
case TOSHIBA_FAN_SPEED_3:
|
||||
this->fan_mode = climate::CLIMATE_FAN_MEDIUM;
|
||||
break;
|
||||
|
||||
case TOSHIBA_FAN_SPEED_5:
|
||||
this->fan_mode = climate::CLIMATE_FAN_HIGH;
|
||||
break;
|
||||
|
||||
case TOSHIBA_FAN_SPEED_AUTO:
|
||||
default:
|
||||
this->fan_mode = climate::CLIMATE_FAN_AUTO;
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the target temperature
|
||||
this->target_temperature = (message[5] >> 4) + TOSHIBA_GENERIC_TEMP_C_MIN;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class ToshibaClimate : public climate_ir::ClimateIR {
|
|||
ToshibaClimate()
|
||||
: climate_ir::ClimateIR(TOSHIBA_GENERIC_TEMP_C_MIN, TOSHIBA_GENERIC_TEMP_C_MAX, 1.0f, true, true,
|
||||
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM,
|
||||
climate::CLIMATE_FAN_HIGH}) {}
|
||||
climate::CLIMATE_FAN_HIGH, climate::CLIMATE_FAN_QUIET}) {}
|
||||
|
||||
void setup() override;
|
||||
void set_model(Model model) { this->model_ = model; }
|
||||
|
|
Loading…
Reference in a new issue